Skip to content

Commit 998052a

Browse files
mrannanjsirainen
authored andcommitted
build-aux: run-test.sh.in - Capture exit codes before set -e ends the script
With set -e, the script ends on any nonzero exit code and that would leave the valgrind output unchecked. Fix the exit code capture so valgrind output is correctly shown.
1 parent 676a0dc commit 998052a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

build-aux/run-test.sh.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
## serial 1
3+
## serial 2
44

55
set -eu
66

@@ -36,12 +36,12 @@ else
3636
test_out="test.out~$$"
3737
trap "rm -f $test_out" 0 1 2 3 15
3838
supp_path="$top_srcdir/run-test-valgrind.supp"
39+
ret=0
3940
if test -r "$supp_path"; then
40-
$VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --suppressions="$supp_path" --log-file=$test_out $noundef "$@"
41+
$VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --suppressions="$supp_path" --log-file=$test_out $noundef "$@" || ret=$?
4142
else
42-
$VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --log-file=$test_out $noundef "$@"
43+
$VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --log-file=$test_out $noundef "$@" || ret=$?
4344
fi
44-
ret=$?
4545
if test -s $test_out; then
4646
cat $test_out
4747
ret=1

0 commit comments

Comments
 (0)