Commit 4ed687c9 authored by Eric Timmons's avatar Eric Timmons
Browse files

Fix run_upgrade_tests function in run-tests.sh

If an upgrade test failed, that function never exited with a non-zero
status. While exit 1 was called, it was in a pipeline, so the exit code was set
as the exit code of the last command in the pipeline (tee) which always exited
0.

Switch to keeping the status in a separate file (like run_tests). A local
variable cannot be used, because the pipeline also makes the block containing
the for loop run in a sub shell.
parent 2a66552c
......@@ -476,6 +476,7 @@ run_upgrade_tests () {
su=test/script-support.lisp
tags="`upgrade_tags`"
methods="`upgrade_methods`"
echo success > build/results/${lisp}-upgrade.status
{
for tag in $tags ; do
for method in $methods ; do
......@@ -491,10 +492,21 @@ run_upgrade_tests () {
echo "$icmd"
echo "then copy/paste:"
echo "(load \"$su\") (asdf-test::da) (test-upgrade $method \"$tag\")"
exit 1 ;}
fi ; done ; done
echo "Upgrade test succeeded for ${lisp}"
echo "failure" > "build/results/${lisp}-upgrade.status" ;}
fi ; done ; done ;
read status < "build/results/${lisp}-upgrade.status"
if [ "$status" = "success" ]; then
echo "Upgrade test succeeded for ${lisp}"
else
echo "Upgrade test failed for ${lisp}"
fi ;
} 2>&1 | tee build/results/${lisp}-upgrade.text
# We need to reread the status because the piping to tee causes everything
# in the block above to be run in a subshell.
read status < "build/results/${lisp}-upgrade.status"
if [ "$status" = "failure" ]; then
exit 1
fi
}
run_tests () {
create_config
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment