diff options
author | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2022-01-24 23:11:28 +0100 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2022-01-24 23:49:04 +0100 |
commit | c6260cfc8f1c3d9b8f0212c8499ed39544f3fd63 (patch) | |
tree | 08ec2c9cc3282e366779c0526184c0ec528ac7cb /samsung-ipc | |
parent | 34a3e1fd501f20c55d41ec9aaa982d79a499bf41 (diff) | |
download | hardware_replicant_libsamsung-ipc-c6260cfc8f1c3d9b8f0212c8499ed39544f3fd63.tar.gz hardware_replicant_libsamsung-ipc-c6260cfc8f1c3d9b8f0212c8499ed39544f3fd63.tar.bz2 hardware_replicant_libsamsung-ipc-c6260cfc8f1c3d9b8f0212c8499ed39544f3fd63.zip |
tests: libsamsung-ipc-test: fix test with out of tree builds
When running the tests in an out of tree build directory (here in
scripts/src/), without that fix, we have the following error in
src/samsung-ipc/tests/test-suite.log when running 'make check':
============================================================
libsamsung-ipc 0.7.0: samsung-ipc/tests/test-suite.log
============================================================
# TOTAL: 1
# PASS: 0
# SKIP: 0
# XFAIL: 0
# FAIL: 1
# XPASS: 0
# ERROR: 0
.. contents:: :depth: 2
FAIL: libsamsung-ipc-test
=========================
Traceback (most recent call last):
File "[...]/scripts/src/samsung-ipc/tests/../../../../samsung-ipc/tests/libsamsung-ipc-test.py", line 54, in <module>
main()
File "[...]/scripts/src/samsung-ipc/tests/../../../../samsung-ipc/tests/libsamsung-ipc-test.py", line 50, in main
tests = libsamsung_ipc_test()
File "[...]/scripts/src/samsung-ipc/tests/../../../../samsung-ipc/tests/libsamsung-ipc-test.py", line 33, in __init__
self.run = sh.Command(srcdir + os.sep + "libsamsung-ipc-test")
File "/usr/lib/python3.9/site-packages/sh.py", line 1342, in __init__
raise CommandNotFound(path)
sh.CommandNotFound: ../../../../samsung-ipc/tests/libsamsung-ipc-test
FAIL libsamsung-ipc-test.py (exit status: 1)
Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
Diffstat (limited to 'samsung-ipc')
-rwxr-xr-x | samsung-ipc/tests/libsamsung-ipc-test.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/samsung-ipc/tests/libsamsung-ipc-test.py b/samsung-ipc/tests/libsamsung-ipc-test.py index 7e819aa..05b64ee 100755 --- a/samsung-ipc/tests/libsamsung-ipc-test.py +++ b/samsung-ipc/tests/libsamsung-ipc-test.py @@ -26,11 +26,16 @@ class libsamsung_ipc_test(object): def __init__(self): srcdir = os.environ.get('srcdir', None) - # Enable also to test without automake - if not srcdir: - srcdir = os.path.dirname(sys.argv[0]) - - self.run = sh.Command(srcdir + os.sep + 'libsamsung-ipc-test') + command_path = '' + if srcdir: + command_path = '.' + os.sep + 'libsamsung-ipc-test' + # Enable to run tests without automake + else: + command_path = os.path.dirname(sys.argv[0]) \ + + os.sep \ + + 'libsamsung-ipc-test' + + self.run = sh.Command(command_path) def run_all_tests(self): output = str(self.run('list-tests')).split(os.linesep) |