From 693c3e1a593318ca996eeda43e7e4f23fc9b9e44 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Thu, 26 Jan 2023 16:14:01 +0100 Subject: [PATCH] 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. --- test/run-unit-tests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/run-unit-tests.py b/test/run-unit-tests.py index 314182d980..4b180cc8df 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') -- 2.25.1