test: allow running only specified subtests/testcases

Useful when debugging, e.g.:

make -C test/TEST-74-AUX-UTILS clean setup run TEST_MATCH_SUBTEST=run

Resolves: #27914
This commit is contained in:
Frantisek Sumsal
2023-06-05 15:58:37 +02:00
committed by Zbigniew Jędrzejewski-Szmek
parent 24945c28db
commit 0efa27bd4b
3 changed files with 21 additions and 0 deletions
+4
View File
@@ -490,6 +490,8 @@ run_qemu() {
"systemd.unit=testsuite.target"
"systemd.wants=testsuite-$1.service"
"noresume"
${TEST_MATCH_SUBTEST:+"systemd.setenv=TEST_MATCH_SUBTEST=$TEST_MATCH_SUBTEST"}
${TEST_MATCH_TESTCASE:+"systemd.setenv=TEST_MATCH_TESTCASE=$TEST_MATCH_TESTCASE"}
)
if ! get_bool "$INTERACTIVE_DEBUG"; then
@@ -567,6 +569,8 @@ run_nspawn() {
"$PATH_TO_INIT"
"systemd.unit=testsuite.target"
"systemd.wants=testsuite-$2.service"
${TEST_MATCH_SUBTEST:+"systemd.setenv=TEST_MATCH_SUBTEST=$TEST_MATCH_SUBTEST"}
${TEST_MATCH_TESTCASE:+"systemd.setenv=TEST_MATCH_TESTCASE=$TEST_MATCH_TESTCASE"}
)
if ! get_bool "$INTERACTIVE_DEBUG"; then