From 57c40b147d07960e4b390980bf1775fa6c29a6d1 Mon Sep 17 00:00:00 2001 From: Jim Hague Date: Wed, 13 Sep 2017 15:02:36 +0100 Subject: [PATCH] Fix capturing exit code of a test. tpkg was not capturing the exit code of the test, but the exit code of the write_result actions. --- src/test/tpkg/tpkg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/tpkg/tpkg b/src/test/tpkg/tpkg index 713adcfb..043d2ece 100755 --- a/src/test/tpkg/tpkg +++ b/src/test/tpkg/tpkg @@ -858,9 +858,10 @@ echo "--------------- Test Output ------------------" | write_result result.$dsc pre out "[log] Executing test" - -( ${SHELL} $dsc_test ${TPKG_ARGS} 2>&1 ) | write_result result.$dsc_basename +( ${SHELL} $dsc_test ${TPKG_ARGS} 2>&1 ) > result.$dsc_basename.tmp test_result=$? +write_result result.$dsc_basename < result.$dsc_basename.tmp +rm -f result.$dsc_basename.tmp epoch # would like to run after post, but that is not possible :-( if [ $test_result -ne 0 ]; then err "[warning] Test executed with errors: $test_result."