@@ -63,12 +63,13 @@ if [ "${VER[0]}" -lt 8 ] ; then
6363 DERIVE_END=' --rc derive_function_end_line=0'
6464fi
6565
66-
67- $COVER $CAPTURE . $LCOV_OPTS --initial -o initial.info $IGNORE_EMPTY $IGNORE_USAGE
68- if [ 0 != $? ] ; then
69- echo " Error: unexpected error code from lcov --initial"
70- if [ $KEEP_GOING == 0 ] ; then
71- exit 1
66+ if [ 1 != $NO_INITIAL_CAPTURE ] ; then
67+ $COVER $CAPTURE . $LCOV_OPTS --initial -o initial.info $IGNORE_EMPTY $IGNORE_USAGE
68+ if [ 0 != $? ] ; then
69+ echo " Error: unexpected error code from lcov --initial"
70+ if [ $KEEP_GOING == 0 ] ; then
71+ exit 1
72+ fi
7273 fi
7374fi
7475
@@ -77,16 +78,17 @@ if [ 0 != $? ] ; then
7778 echo " Error: unexpected error from gcc"
7879 exit 1
7980fi
80- # capture 'all' - which will pick up the unused file
81- $COVER $CAPTURE . $LCOV_OPTS --all -o all_initial.info $IGNORE_EMPTY $IGNORE_USAGE
82- if [ 0 != $? ] ; then
83- echo " Error: unexpected error code from lcov --capture --all"
84- if [ $KEEP_GOING == 0 ] ; then
85- exit 1
86- fi
87- fi
8881
8982if [ " $NO_INITIAL_CAPTURE " != 1 ] ; then
83+ # capture 'all' - which will pick up the unused file
84+ $COVER $CAPTURE . $LCOV_OPTS --all -o all_initial.info $IGNORE_EMPTY $IGNORE_USAGE
85+ if [ 0 != $? ] ; then
86+ echo " Error: unexpected error code from lcov --capture --all"
87+ if [ $KEEP_GOING == 0 ] ; then
88+ exit 1
89+ fi
90+ fi
91+
9092 # does the result contain file 'uused'
9193 grep -E " SF:.+unused.c$" all_initial.info
9294 if [ $? != 0 ] ; then
@@ -891,27 +893,29 @@ mkdir -pv ./mytest
891893echo " int main(){}" > ' ./mytest/main space.cpp'
892894( cd ./mytest ; ${CXX} -c ' main space.cpp' --coverage )
893895
894- $COVER $CAPTURE mytest -i -o spaces.info
895- if [ 0 != $? ] ; then
896- echo " Error: unexpected error from filename containing space"
897- if [ $KEEP_GOING == 0 ] ; then
898- exit 1
896+ if [ 1 != $NO_INITIAL_CAPTURE ] ; then
897+ $COVER $CAPTURE mytest -i -o spaces.info
898+ if [ 0 != $? ] ; then
899+ echo " Error: unexpected error from filename containing space"
900+ if [ $KEEP_GOING == 0 ] ; then
901+ exit 1
902+ fi
899903 fi
900- fi
901904
902- $COVER $LCOV_TOOL --list spaces.info
903- if [ 0 != $? ] ; then
904- echo " Error: unable to list filename containing space"
905- if [ $KEEP_GOING == 0 ] ; then
906- exit 1
905+ $COVER $LCOV_TOOL --list spaces.info
906+ if [ 0 != $? ] ; then
907+ echo " Error: unable to list filename containing space"
908+ if [ $KEEP_GOING == 0 ] ; then
909+ exit 1
910+ fi
907911 fi
908- fi
909912
910- $COVER $GENHTML_TOOL -o spaces spaces.info
911- if [ 0 != $? ] ; then
912- echo " Error: unable to generate HTML for filename containing space"
913- if [ $KEEP_GOING == 0 ] ; then
914- exit 1
913+ $COVER $GENHTML_TOOL -o spaces spaces.info
914+ if [ 0 != $? ] ; then
915+ echo " Error: unable to generate HTML for filename containing space"
916+ if [ $KEEP_GOING == 0 ] ; then
917+ exit 1
918+ fi
915919 fi
916920fi
917921
0 commit comments