mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
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.
This commit is contained in:
parent
ccde62954c
commit
693c3e1a59
@ -2,7 +2,6 @@
|
|||||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import glob
|
|
||||||
import os
|
import os
|
||||||
import pathlib
|
import pathlib
|
||||||
import subprocess
|
import subprocess
|
||||||
@ -33,9 +32,11 @@ def argument_parser():
|
|||||||
|
|
||||||
opts = argument_parser().parse_args()
|
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:
|
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'):
|
if not opts.artifact_directory and os.getenv('ARTIFACT_DIRECTORY'):
|
||||||
opts.artifact_directory = os.getenv('ARTIFACT_DIRECTORY')
|
opts.artifact_directory = os.getenv('ARTIFACT_DIRECTORY')
|
||||||
|
Loading…
Reference in New Issue
Block a user