summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2024-12-10 12:56:04 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2024-12-10 16:18:39 +0100
commitb8a34813b094464b2e9fa19414551edb0bc12cc5 (patch)
treefbfb7428af7d10d4437a0276c49c6034b1a9dd90 /test
parentCryptenroll pager and tweaks (#35517) (diff)
downloadsystemd-b8a34813b094464b2e9fa19414551edb0bc12cc5.tar.xz
systemd-b8a34813b094464b2e9fa19414551edb0bc12cc5.zip
test: add TEST_SKIP_SUBTESTS/TEST_SKIP_TESTCASES
Inverse of the TEST_MATCH_SUBTEST/TEST_MATCH_TESTCASE variables
Diffstat (limited to 'test')
-rw-r--r--test/README.testsuite4
-rw-r--r--test/units/test-control.sh21
2 files changed, 25 insertions, 0 deletions
diff --git a/test/README.testsuite b/test/README.testsuite
index e86307195c..5546fcf8b1 100644
--- a/test/README.testsuite
+++ b/test/README.testsuite
@@ -147,6 +147,10 @@ that make use of `run_testcases`.
`TEST_SKIP`: takes a space separated list of tests to skip.
+`TEST_SKIP_SUBTEST=subtest`: takes a space separated list of subtests to skip.
+
+`TEST_SKIP_TESTCASE=testcase`: takes a space separated list of testcases to skip.
+
## Ubuntu CI
New PRs submitted to the project are run through regression tests, and one set
diff --git a/test/units/test-control.sh b/test/units/test-control.sh
index 4cede74d50..4546231d68 100644
--- a/test/units/test-control.sh
+++ b/test/units/test-control.sh
@@ -91,6 +91,13 @@ run_subtests_with_signals() {
continue
fi
+ for skip in ${TEST_SKIP_SUBTESTS:-}; do
+ if [[ "$subtest" =~ $skip ]]; then
+ echo "Skipping $subtest (matching '$skip')"
+ continue 2
+ fi
+ done
+
: "--- $subtest BEGIN ---"
SECONDS=0
"./$subtest" &
@@ -123,6 +130,13 @@ run_subtests() {
continue
fi
+ for skip in ${TEST_SKIP_SUBTESTS:-}; do
+ if [[ "$subtest" =~ $skip ]]; then
+ echo "Skipping $subtest (matching '$skip')"
+ continue 2
+ fi
+ done
+
: "--- $subtest BEGIN ---"
SECONDS=0
if ! "./$subtest"; then
@@ -155,6 +169,13 @@ run_testcases() {
continue
fi
+ for skip in ${TEST_SKIP_TESTCASES:-}; do
+ if [[ "$testcase" =~ $skip ]]; then
+ echo "Skipping $testcase (matching '$skip')"
+ continue 2
+ fi
+ done
+
: "+++ $testcase BEGIN +++"
# Note: the subshell here is used purposefully, otherwise we might
# unexpectedly inherit a RETURN trap handler from the called