@@ -131,7 +131,7 @@ LCOV_OPTS="$LCOV_BASE"
131
131
DIFFCOV_OPTS=" --filter line,branch,function --function-coverage --branch-coverage --highlight --demangle-cpp --prefix $PARENT_VERSION $PROFILE "
132
132
133
133
rm -f test.cpp * .gcno * .gcda a.out * .info * .log * .json diff.txt
134
- rm -rf select criteria annotate empty unused_src scriptErr scriptFixed
134
+ rm -rf select criteria annotate empty unused_src scriptErr scriptFixed epoch inconsistent
135
135
136
136
if [ " x$COVER " != ' x' ] && [ 0 != $LOCAL_COVERAGE ] ; then
137
137
cover -delete
@@ -526,6 +526,57 @@ if [ 0 != $? ] ; then
526
526
exit 1
527
527
fi
528
528
fi
529
+
530
+ # inconsistent setting of branch filtering without enabling branch coverage
531
+ echo genhtml --filter branch --prefix $PARENT_VERSION $PROFILE initial.info -o inconsistent --rc treat_warning_as_error=1
532
+ $COVER $GENHTML_TOOL --filter branch --prefix $PARENT_VERSION $PROFILE initial.info -o inconsistent --rc treat_warning_as_error=1 2>&1 | tee inconsistent.log
533
+ if [ 0 == ${PIPESTATUS[0]} ] ; then
534
+ echo " ERROR: genhtml inconsistent warning-as-error passed by accident"
535
+ if [ 0 == $KEEP_GOING ] ; then
536
+ exit 1
537
+ fi
538
+ fi
539
+ grep ' ERROR: (usage) branch filter enabled but branch coverage not enabled' inconsistent.log
540
+ if [ 0 != $? ] ; then
541
+ echo " ERROR: missing inconsistency message"
542
+ if [ 0 == $KEEP_GOING ] ; then
543
+ exit 1
544
+ fi
545
+ fi
546
+
547
+ # when we treat warning as error, but ignore the message type
548
+ echo genhtml --filter branch --prefix $PARENT_VERSION $PROFILE initial.info -o inconsistent --rc treat_warning_as_error=1 --ignore usage
549
+ $COVER $GENHTML_TOOL --filter branch --prefix $PARENT_VERSION $PROFILE initial.info -o inconsistent --rc treat_warning_as_error=1 --ignore usage 2>&1 | tee inconsistent.log
550
+ if [ 0 != ${PIPESTATUS[0]} ] ; then
551
+ echo " ERROR: genhtml inconsistent warning-as-error passed by accident"
552
+ if [ 0 == $KEEP_GOING ] ; then
553
+ exit 1
554
+ fi
555
+ fi
556
+ grep ' WARNING: (usage) branch filter enabled but branch coverage not enabled' inconsistent.log
557
+ if [ 0 != $? ] ; then
558
+ echo " ERROR: missing inconsistency message"
559
+ if [ 0 == $KEEP_GOING ] ; then
560
+ exit 1
561
+ fi
562
+ fi
563
+
564
+ echo genhtml --filter branch --prefix $PARENT_VERSION $PROFILE initial.info -o inconsistent
565
+ $COVER $GENHTML_TOOL --filter branch --prefix $PARENT_VERSION $PROFILE initial.info -o inconsistent 2>&1 | tee inconsistent2.log
566
+ if [ 0 != ${PIPESTATUS[0]} ] ; then
567
+ echo " ERROR: genhtml inconsistent warning-as-error failed"
568
+ if [ 0 == $KEEP_GOING ] ; then
569
+ exit 1
570
+ fi
571
+ fi
572
+ grep ' WARNING: (usage) branch filter enabled but branch coverage not enabled' inconsistent2.log
573
+ if [ 0 != $? ] ; then
574
+ echo " ERROR: missing inconsistency message 2"
575
+ if [ 0 == $KEEP_GOING ] ; then
576
+ exit 1
577
+ fi
578
+ fi
579
+
529
580
530
581
echo " Tests passed"
531
582
0 commit comments