Skip to content

Commit

Permalink
Make extraction tests work without ${USER} (fixes #378) (#383)
Browse files Browse the repository at this point in the history
* extract.sh: Use "grep -F" where possible
* extract.sh: Set ${USER} when not set or empty in environment

Signed-off-by: Sebastian Pipping <[email protected]>
  • Loading branch information
hartwork authored Jan 11, 2025
1 parent 54ce5db commit f53848b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/lcov/extract/extract.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/bin/bash
set +x

: ${USER:="$(id -u -n)"}

source ../../common.tst

rm -rf *.gcda *.gcno a.out *.info* *.txt* *.json dumper* testRC *.gcov *.gcov.* *.log *.o errs *.msg *.dat
Expand Down Expand Up @@ -217,7 +219,7 @@ if [ 0 != $? ] ; then
fi
fi
grep -E "\"user\":\"$USER\"" context.info.json
grep -F "\"user\":\"$USER\"" context.info.json
if [ 0 != $? ] ; then
echo "Error: did not find expected context field"
if [ $KEEP_GOING == 0 ] ; then
Expand All @@ -241,7 +243,7 @@ if [ 0 != $? ] ; then
fi
fi
grep -E "\"user\":\"$USER\"" context.info.json
grep -F "\"user\":\"$USER\"" context.info.json
if [ 0 != $? ] ; then
echo "Error: did not find expected context field"
if [ $KEEP_GOING == 0 ] ; then
Expand Down

0 comments on commit f53848b

Please sign in to comment.