From 0ac94c8ab7ad508b090a892f9d55c4bce7e79bed Mon Sep 17 00:00:00 2001 From: James Craig Burley <430319+jcburley@users.noreply.github.com> Date: Tue, 14 Dec 2021 13:41:33 -0500 Subject: [PATCH] With -e in effect, a nonzero status code exits immediately, so capture it (#270) Co-authored-by: James Craig Burley Co-authored-by: Ido David <36866853+ido-namely@users.noreply.github.com> --- all/test.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/all/test.sh b/all/test.sh index ce9eea8b..31660497 100755 --- a/all/test.sh +++ b/all/test.sh @@ -23,9 +23,8 @@ testGeneration() { echo "Testing language $lang $expected_output_dir $extra_args" # Test calling a file directly. - docker run --rm -v=`pwd`:/defs $CONTAINER -f all/test/test.proto -l $lang -i all/test/ $extra_args > /dev/null - - exitCode=$? + exitCode=0 + docker run --rm -v=`pwd`:/defs $CONTAINER -f all/test/test.proto -l $lang -i all/test/ $extra_args > /dev/null || exitCode=$? if [[ $expectedExitCode != $exitCode ]]; then echo "exit code must be $expectedExitCode but is $exitCode instead"