From: Frantisek Sumsal Date: Sat, 24 Jun 2023 18:43:26 +0000 (+0200) Subject: test: show the subtest name together with the failing code X-Git-Tag: v254-rc1~120^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4c88752ae534fb0c35cc946da866106927a1ab73;p=thirdparty%2Fsystemd.git test: show the subtest name together with the failing code To make debugging slightly easier. --- diff --git a/test/units/test-control.sh b/test/units/test-control.sh index 017f6410c9f..b8a57cb6eab 100644 --- a/test/units/test-control.sh +++ b/test/units/test-control.sh @@ -89,7 +89,12 @@ run_subtests_with_signals() { : "--- $subtest BEGIN ---" "./$subtest" & _CHILD_PID=$! - _wait_harder "$_CHILD_PID" && _PASSED_TESTS+=("$subtest") || return 1 + if ! _wait_harder "$_CHILD_PID"; then + echo "Subtest $subtest failed" + return 1 + fi + + _PASSED_TESTS+=("$subtest") : "--- $subtest END ---" done @@ -113,7 +118,12 @@ run_subtests() { fi : "--- $subtest BEGIN ---" - "./$subtest" && _PASSED_TESTS+=("$subtest") || return 1 + if ! "./$subtest"; then + echo "Subtest $subtest failed" + return 1 + fi + + _PASSED_TESTS+=("$subtest") : "--- $subtest END ---" done