Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle space in filename. See #384. #386

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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
Expand Down Expand Up @@ -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"

Expand Down