diff --git a/bin/geninfo b/bin/geninfo index b35ef15b..bdd734ec 100755 --- a/bin/geninfo +++ b/bin/geninfo @@ -972,7 +972,8 @@ sub find_files } else { $lcovutil::profileData{find}{$directory} = $time; } - my @found = split(' ', $stdout); + # split on crlf + my @found = split(/[\x0A\x0D]/, $stdout); if (!@found) { if (!defined($processGcno) || $processGcno != 2) { # delay message: might be a file of other type here diff --git a/tests/lcov/extract/extract.sh b/tests/lcov/extract/extract.sh index ae31d7dc..e9047126 100755 --- a/tests/lcov/extract/extract.sh +++ b/tests/lcov/extract/extract.sh @@ -5,7 +5,7 @@ set +x source ../../common.tst -rm -rf *.gcda *.gcno a.out *.info* *.txt* *.json dumper* testRC *.gcov *.gcov.* *.log *.o errs *.msg *.dat +rm -rf *.gcda *.gcno a.out *.info* *.txt* *.json dumper* testRC *.gcov *.gcov.* *.log *.o errs *.msg *.dat mytest spaces rm -rf rcOptBug if [ -d separate ] ; then @@ -885,6 +885,36 @@ if [ 0 == $? ] ; then fi fi +# test filename containing spaces +rm -rf ./mytest +mkdir -pv ./mytest +echo "int main(){}" > './mytest/main space.cpp' +( cd ./mytest ; ${CXX} -c 'main space.cpp' --coverage ) + +$COVER $CAPTURE mytest -i -o spaces.info +if [ 0 != $? ] ; then + echo "Error: unexpected error from filename containing space" + if [ $KEEP_GOING == 0 ] ; then + exit 1 + fi +fi + +$COVER $LCOV_TOOL --list spaces.info +if [ 0 != $? ] ; then + echo "Error: unable to list filename containing space" + if [ $KEEP_GOING == 0 ] ; then + exit 1 + fi +fi + +$COVER $GENHTML_TOOL -o spaces spaces.info +if [ 0 != $? ] ; then + echo "Error: unable to generate HTML for filename containing space" + if [ $KEEP_GOING == 0 ] ; then + exit 1 + fi +fi + echo "Tests passed"