Skip to content
Snippets Groups Projects
Commit ffa83be4 authored by Martti Rannanjärvi's avatar Martti Rannanjärvi Committed by timo.sirainen
Browse files

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.
parent aeb5366a
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
## serial 1
## serial 2
set -eu
......@@ -36,12 +36,12 @@ else
test_out="test.out~$$"
trap "rm -f $test_out" 0 1 2 3 15
supp_path="$top_srcdir/run-test-valgrind.supp"
ret=0
if test -r "$supp_path"; then
$VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --suppressions="$supp_path" --log-file=$test_out $noundef "$@"
$VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --suppressions="$supp_path" --log-file=$test_out $noundef "$@" || ret=$?
else
$VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --log-file=$test_out $noundef "$@"
$VALGRIND -q $trace_children --error-exitcode=213 --leak-check=full --gen-suppressions=all --log-file=$test_out $noundef "$@" || ret=$?
fi
ret=$?
if test -s $test_out; then
cat $test_out
ret=1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.