From: Zbigniew Jędrzejewski-Szmek Date: Fri, 21 Sep 2018 07:28:28 +0000 (+0200) Subject: run-unit-tests: add option to run unsafe tests too X-Git-Tag: v240~625^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f5acf84dbed6365c484c577ba7245d4054750ef2;p=thirdparty%2Fsystemd.git run-unit-tests: add option to run unsafe tests too --- diff --git a/test/run-unit-tests.py b/test/run-unit-tests.py index 4bbc3e2c447..9a75cd421ec 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)