]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
TESTS: change the output of run-unittests.sh
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 6 Mar 2025 16:43:11 +0000 (17:43 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 6 Mar 2025 16:53:53 +0000 (17:53 +0100)
- "check" is run with sh -e so it will stop at the first error
- output of "check" is not shown anymore
- add a line with the name of the failed test

scripts/run-unittests.sh

index 4e06b0effeac7a5d0462b3aee54914e7031eb051..318e7ff338085aa6f9095c5c86178ad985e214ca 100755 (executable)
@@ -52,7 +52,7 @@ testlist=
 echo "########################## Gathering tests to run ##########################"
 
 for test in $(find "$TESTDIR" -name "*.sh"); do
-       sh ${test} check
+       sh -e ${test} check 2>&1 1>/dev/null
        r="$?"
        if [ "$r" = "0" ]; then
                echo "  Add test: $test"
@@ -70,10 +70,10 @@ for TEST in $testlist; do
        export TEST
        export TESTDIR=`dirname ${TEST}`
 
-       sh -e ${TEST} run
+       sh -e ${TEST} run 2>&1 1>/dev/null
        r="$?"
-#      echo "*** result ${TEST}: $r"
        if [ "$r" != "0" ]; then
+               echo "Test ${TEST} failed: $r"
                result=$r
                failed=$((failed+1))
        else