exit 1
fi
-# If we're running with TEST_PREFER_NSPAWN=1 limit the set of tests we run
-# in QEMU to only those that can't run in a container to avoid running
-# the same tests again in a, most likely, very slow environment
-if ! systemd-detect-virt -qc && [[ "${TEST_PREFER_NSPAWN:-0}" -ne 0 ]]; then
- TESTS_GLOB="test-loop-block"
-else
- TESTS_GLOB=${TESTS_GLOB:-test-*}
+if [[ -z "${TEST_MATCH_SUBTEST:-}" ]]; then
+ # If we're running with TEST_PREFER_NSPAWN=1 limit the set of tests we run
+ # in QEMU to only those that can't run in a container to avoid running
+ # the same tests again in a, most likely, very slow environment
+ if ! systemd-detect-virt -qc && [[ "${TEST_PREFER_NSPAWN:-0}" -ne 0 ]]; then
+ TEST_MATCH_SUBTEST="test-loop-block"
+ else
+ TEST_MATCH_SUBTEST="test-*"
+ fi
fi
NPROC=$(nproc)
export -f run_test
-find /usr/lib/systemd/tests/unit-tests/ -maxdepth 1 -type f -name "${TESTS_GLOB}" -print0 |
+find /usr/lib/systemd/tests/unit-tests/ -maxdepth 1 -type f -name "${TEST_MATCH_SUBTEST}" -print0 |
xargs -0 -I {} --max-procs="$MAX_QUEUE_SIZE" bash -ec "run_test {}"
# Write all pending messages, so they don't get mixed with the summaries below