summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFranck Bui <fbui@suse.com>2023-01-26 16:14:01 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-03-15 09:19:33 +0100
commit693c3e1a593318ca996eeda43e7e4f23fc9b9e44 (patch)
tree3bb977eba101b25fc0e54376f7b382f4d807fafb /test
parentccde62954ccf5ee73b40774b8f5d3a9dd2869201 (diff)
downloadsystemd-693c3e1a593318ca996eeda43e7e4f23fc9b9e44.tar.gz
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.
Diffstat (limited to 'test')
-rwxr-xr-xtest/run-unit-tests.py7
1 files 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')