@@ -84,7 +84,7 @@ PARENT=`(cd .. ; pwd)`
8484
8585LCOV_OPTS=" --branch-coverage --no-external $PARALLEL $PROFILE "
8686
87- rm -rf * .gcda * .gcno a.out * .info* * .txt* * .json dumper* testRC * .gcov * .gcov.*
87+ rm -rf * .gcda * .gcno a.out * .info* * .txt* * .json dumper* testRC * .gcov * .gcov.* * .log
8888
8989if [ " x$COVER " != ' x' ] && [ 0 != $LOCAL_COVERAGE ] ; then
9090 cover -delete
109109${CXX} -std=c++1y --coverage demangle.cpp
110110./a.out 1
111111
112- $COVER $LCOV_TOOL $LCOV_OPTS --capture --filter branch --demangle --directory . -o demangle.info
112+ $COVER $LCOV_TOOL $LCOV_OPTS --capture --filter branch --demangle --directory . -o demangle.info --rc derive_function_end_line=0
113113
114114$COVER $LCOV_TOOL $LCOV_OPTS --list demangle.info
115115
@@ -223,21 +223,55 @@ else
223223 # no end line in data - check for error message...
224224 echo " ----------------------"
225225 echo " compiler version DOESN't support start/end reporting - check error"
226- $COVER $LCOV_TOOL $LCOV_OPTS --capture --filter branch --demangle-cpp --directory . --erase-functions main --ignore unused -o exclude.info
226+ $COVER $LCOV_TOOL $LCOV_OPTS --capture --filter branch --demangle-cpp --directory . --erase-functions main --ignore unused -o exclude.info --rc derive_function_end_line=0 --msg-log exclude.log
227227 if [ 0 == $? ] ; then
228228 echo " Error: expected exit for unsupported feature"
229229 if [ $KEEP_GOING == 0 ] ; then
230230 exit 1
231231 fi
232232 fi
233233
234- $COVER $LCOV_TOOL $LCOV_OPTS --capture --filter branch --demangle-cpp --directory . --erase-functions main --ignore unsupported,unused -o ignore.info
234+ grep -E ' ERROR: .+Function begin/end line exclusions not supported' exclude.log
235+ if [ 0 != $? ] ; then
236+ echo " Error: didn't find unsupported message"
237+ if [ $KEEP_GOING == 0 ] ; then
238+ exit 1
239+ fi
240+ fi
241+
242+ $COVER $LCOV_TOOL $LCOV_OPTS --capture --filter branch --demangle-cpp --directory . --erase-functions main --ignore unused -o exclude2.info --rc derive_function_end_line=1 --msg-log exclude2.log
243+ if [ 0 != $? ] ; then
244+ echo " Error: unexpected exit when 'derive' enabled"
245+ if [ $KEEP_GOING == 0 ] ; then
246+ exit 1
247+ fi
248+ fi
249+
250+ grep -E ' WARNING: .+Function begin/end line exclusions.+attempting to derive' exclude2.log
251+ if [ 0 != $? ] ; then
252+ echo " Error: didn't find derive warning"
253+ if [ $KEEP_GOING == 0 ] ; then
254+ exit 1
255+ fi
256+
257+ fi
258+
259+ $COVER $LCOV_TOOL $LCOV_OPTS --capture --filter branch --demangle-cpp --directory . --erase-functions main --rc derive_function_end_line=0 --ignore unsupported,unused -o ignore.info --msg-log=exclude3.log
235260 if [ 0 != $? ] ; then
236261 echo " Error: expected to ignore unsupported message"
237262 if [ $KEEP_GOING == 0 ] ; then
238263 exit 1
239264 fi
240265 fi
266+ grep -E ' WARNING: .+Function begin/end line exclusions.+See lcovrc man entry' exclude3.log
267+ if [ 0 != $? ] ; then
268+ echo " Error: didn't find derive warning2"
269+ if [ $KEEP_GOING == 0 ] ; then
270+ exit 1
271+ fi
272+
273+ fi
274+
241275 # expect not to find 'main'
242276 grep main ignore.info
243277 if [ $? == 0 ] ; then
0 commit comments