]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: assume run-unit-tests.py and unit tests are installed in the same directory
authorFranck Bui <fbui@suse.com>
Thu, 26 Jan 2023 15:14:01 +0000 (16:14 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 15 Mar 2023 08:19:33 +0000 (09:19 +0100)
This avoids hard coding the path of the directory where the unit tests are
installed.

test/run-unit-tests.py

index 314182d980a20386c9fbbb6b7cf44fc6914c5d9f..4b180cc8df0814f7a3be5ce5625f9df385d9b4a1 100755 (executable)
@@ -2,7 +2,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
 import argparse
-import glob
 import os
 import pathlib
 import subprocess
@@ -33,9 +32,11 @@ def argument_parser():
 
 opts = argument_parser().parse_args()
 
-tests = glob.glob('/usr/lib/systemd/tests/test-*')
+unittestdir = pathlib.Path(__file__).parent.absolute()
+
+tests = list(unittestdir.glob('test-*'))
 if opts.unsafe:
-    tests += glob.glob('/usr/lib/systemd/tests/unsafe/test-*')
+    tests += unittestdir.glob('unsafe/test-*')
 
 if not opts.artifact_directory and os.getenv('ARTIFACT_DIRECTORY'):
     opts.artifact_directory = os.getenv('ARTIFACT_DIRECTORY')