Skip to content
This repository was archived by the owner on May 20, 2024. It is now read-only.

Commit e790a2b

Browse files
CodingMarkusCodingMarkus
CodingMarkus
authored and
CodingMarkus
committed
Print correct exit code on test failure
1 parent d91e8b1 commit e790a2b

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

test/run_all_tests.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@ for test in \
1111
"$cmdBase/basic/bin/"test_*.sh \
1212
"$cmdBase/file/bin/"test_*.sh
1313
do
14-
if ! ( cd "$( dirname "$test" )" ; eval "./$( basename "$test" )" )
15-
then
16-
echo "$test failed with exit code: $?" >&2
17-
exit 1
18-
fi
14+
(
15+
error=0
16+
cd "$( dirname "$test" )"
17+
"./$( basename "$test" )" || error=$?
18+
if [ $error -ne 0 ]
19+
then
20+
echo "$test failed with exit code: $error" >&2
21+
exit 1
22+
fi
23+
)
1924
done

0 commit comments

Comments
 (0)