summaryrefslogtreecommitdiffstats
path: root/test/run-unit-tests.py
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2024-03-11 17:41:02 +0100
committerLuca Boccassi <luca.boccassi@gmail.com>2024-03-12 00:27:01 +0100
commit59e33acc8e1d124324b36cda2f7ec0c7f8e49df9 (patch)
tree11bec4b532c1284351f8c5748cbd5559c0b95d92 /test/run-unit-tests.py
parentMerge pull request #31721 from aafeijoo-suse/service-util-help-fix (diff)
downloadsystemd-59e33acc8e1d124324b36cda2f7ec0c7f8e49df9.tar.xz
systemd-59e33acc8e1d124324b36cda2f7ec0c7f8e49df9.zip
tests/run-unit-tests: add option to skip tests
In automated QA environments there may be tests that are known to fail, and being able to skip them is useful to remove known failures from the test log. Signed-off-by: Ross Burton <ross.burton@arm.com>
Diffstat (limited to '')
-rwxr-xr-xtest/run-unit-tests.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/run-unit-tests.py b/test/run-unit-tests.py
index 1b0329644b..de8ac5c26c 100755
--- a/test/run-unit-tests.py
+++ b/test/run-unit-tests.py
@@ -28,6 +28,9 @@ def argument_parser():
help='run "unsafe" tests too')
p.add_argument('-A', '--artifact_directory',
help='store output from failed tests in this dir')
+ p.add_argument('-s', '--skip', action='append', default=[],
+ help='skip the named test')
+
return p
opts = argument_parser().parse_args()
@@ -45,6 +48,11 @@ total.total = len(tests)
for test in sorted(tests):
name = os.path.basename(test)
+ if name in opts.skip:
+ print(f'{YELLOW}SKIP: {name} (by user) {RESET_ALL}')
+ total.skip += 1
+ continue
+
ex = subprocess.run(test, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
if ex.returncode == 0:
print(f'{GREEN}PASS: {name}{RESET_ALL}')