Skip to content

Commit

Permalink
Handle spaces in filename - see linux-test-project#384
Browse files Browse the repository at this point in the history
Signed-off-by:  Henry Cox <[email protected]>
  • Loading branch information
henry2cox committed Jan 15, 2025
1 parent 2b0977d commit 069e268
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bin/geninfo
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 31 additions & 1 deletion tests/lcov/extract/extract.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,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
Expand Down Expand Up @@ -883,6 +883,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 geneate HTML for filename containing space"

Check failure on line 910 in tests/lcov/extract/extract.sh

View workflow job for this annotation

GitHub Actions / Enforce codespell-clean spelling

geneate ==> generate
if [ $KEEP_GOING == 0 ] ; then
exit 1
fi
fi
echo "Tests passed"
Expand Down

0 comments on commit 069e268

Please sign in to comment.