From f5acf84dbed6365c484c577ba7245d4054750ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 21 Sep 2018 09:28:28 +0200 Subject: [PATCH] run-unit-tests: add option to run unsafe tests too --- test/run-unit-tests.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/run-unit-tests.py b/test/run-unit-tests.py index 4bbc3e2c44..9a75cd421e 100755 --- a/test/run-unit-tests.py +++ b/test/run-unit-tests.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 +import argparse import dataclasses import glob import os @@ -22,7 +23,18 @@ class Total: skip:int = 0 fail:int = 0 +def argument_parser(): + p = argparse.ArgumentParser() + p.add_argument('-u', '--unsafe', action='store_true', + help='run "unsafe" tests too') + return p + +opts = argument_parser().parse_args() + tests = glob.glob('/usr/lib/systemd/tests/test-*') +if opts.unsafe: + tests += glob.glob('/usr/lib/systemd/tests/unsafe/test-*') + total = Total(total=len(tests)) for test in tests: name = os.path.basename(test)