Skip to content

Commit f53848b

Browse files
authored
Make extraction tests work without ${USER} (fixes #378) (#383)
* 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]>
1 parent 54ce5db commit f53848b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/lcov/extract/extract.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22
set +x
33

4+
: ${USER:="$(id -u -n)"}
5+
46
source ../../common.tst
57

68
rm -rf *.gcda *.gcno a.out *.info* *.txt* *.json dumper* testRC *.gcov *.gcov.* *.log *.o errs *.msg *.dat
@@ -217,7 +219,7 @@ if [ 0 != $? ] ; then
217219
fi
218220
fi
219221
220-
grep -E "\"user\":\"$USER\"" context.info.json
222+
grep -F "\"user\":\"$USER\"" context.info.json
221223
if [ 0 != $? ] ; then
222224
echo "Error: did not find expected context field"
223225
if [ $KEEP_GOING == 0 ] ; then
@@ -241,7 +243,7 @@ if [ 0 != $? ] ; then
241243
fi
242244
fi
243245
244-
grep -E "\"user\":\"$USER\"" context.info.json
246+
grep -F "\"user\":\"$USER\"" context.info.json
245247
if [ 0 != $? ] ; then
246248
echo "Error: did not find expected context field"
247249
if [ $KEEP_GOING == 0 ] ; then

0 commit comments

Comments
 (0)