From: Franck Bui Date: Thu, 26 Jan 2023 15:14:01 +0000 (+0100) Subject: test: assume run-unit-tests.py and unit tests are installed in the same directory X-Git-Tag: v254-rc1~1023 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=693c3e1a593318ca996eeda43e7e4f23fc9b9e44;p=thirdparty%2Fsystemd.git test: assume run-unit-tests.py and unit tests are installed in the same directory This avoids hard coding the path of the directory where the unit tests are installed. --- diff --git a/test/run-unit-tests.py b/test/run-unit-tests.py index 314182d980a..4b180cc8df0 100755 --- a/test/run-unit-tests.py +++ b/test/run-unit-tests.py @@ -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')