test: print test of name in output

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-03-25 13:15:37 +01:00
parent e2d612a8e4
commit 8af10ca3fc
2 changed files with 12 additions and 10 deletions

View File

@ -10,10 +10,10 @@ ninja: no work to do.
--x-- Running TEST-01-BASIC --x--
+ make -C TEST-01-BASIC BUILD_DIR=/home/zbyszek/src/systemd/build clean setup run
make: Entering directory '/home/zbyszek/src/systemd/test/TEST-01-BASIC'
TEST CLEANUP: Basic systemd setup
TEST SETUP: Basic systemd setup
TEST-01-BASIC CLEANUP: Basic systemd setup
TEST-01-BASIC SETUP: Basic systemd setup
...
TEST RUN: Basic systemd setup [OK]
TEST-01-BASIC RUN: Basic systemd setup [OK]
make: Leaving directory '/home/zbyszek/src/systemd/test/TEST-01-BASIC'
--x-- Result of TEST-01-BASIC: 0 --x--
--x-- Running TEST-02-CRYPTSETUP --x--

View File

@ -2035,34 +2035,36 @@ do_test() {
import_testdir
import_initdir
testname="$(basename $PWD)"
while (($# > 0)); do
case $1 in
--run)
echo "TEST RUN: $TEST_DESCRIPTION"
echo "${testname} RUN: $TEST_DESCRIPTION"
test_run "$2"
ret=$?
if (( $ret == 0 )); then
echo "TEST RUN: $TEST_DESCRIPTION [OK]"
echo "${testname} RUN: $TEST_DESCRIPTION [OK]"
else
echo "TEST RUN: $TEST_DESCRIPTION [FAILED]"
echo "${testname} RUN: $TEST_DESCRIPTION [FAILED]"
fi
exit $ret;;
--setup)
echo "TEST SETUP: $TEST_DESCRIPTION"
echo "${testname} SETUP: $TEST_DESCRIPTION"
test_setup
test_setup_cleanup
;;
--clean)
echo "TEST CLEANUP: $TEST_DESCRIPTION"
echo "${testname} CLEANUP: $TEST_DESCRIPTION"
test_cleanup
;;
--clean-again)
echo "TEST CLEANUP AGAIN: $TEST_DESCRIPTION"
echo "${testname} CLEANUP AGAIN: $TEST_DESCRIPTION"
test_cleanup_again
;;
--all)
ret=0
echo -n "TEST: $TEST_DESCRIPTION "
echo -n "${testname}: $TEST_DESCRIPTION "
(
test_setup
test_setup_cleanup