Skip to content

Commit a46cb12

Browse files
authored
selfcheck.sh: actually fail if we encountered unexpected errors (#437)
1 parent eb18d11 commit a46cb12

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

selfcheck.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/sh
22

3-
output=$(./simplecpp simplecpp.cpp -e 2>&1)
3+
output=$(./simplecpp simplecpp.cpp -e -f 2>&1)
44
ec=$?
5-
echo "$output" | grep -v 'Header not found: <'
6-
exit $ec
5+
errors=$(echo "$output" | grep -v 'Header not found: <')
6+
if [ $ec -ne 0 ]; then
7+
# only fail if got errors which do not refer to missing system includes
8+
if [ ! -z "$errors" ]; then
9+
exit $ec
10+
fi
11+
fi

0 commit comments

Comments
 (0)