aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-01-24 23:11:28 +0100
committerDenis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>2022-01-24 23:49:06 +0100
commitd37bae98a730e8a7756ed94ce15590794d973941 (patch)
tree7339e99bc8f9f549007284bf1c618afcf3315230
parentc6260cfc8f1c3d9b8f0212c8499ed39544f3fd63 (diff)
downloadhardware_replicant_libsamsung-ipc-d37bae98a730e8a7756ed94ce15590794d973941.tar.gz
hardware_replicant_libsamsung-ipc-d37bae98a730e8a7756ed94ce15590794d973941.tar.bz2
hardware_replicant_libsamsung-ipc-d37bae98a730e8a7756ed94ce15590794d973941.zip
tests: ipc-modem: 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': FAIL: ipc-modem =============== Traceback (most recent call last): File "[...]/scripts/src/tools/../../../tools/ipc-modem.py", line 79, in <module> rc = main() File "[...]/scripts/src/tools/../../../tools/ipc-modem.py", line 74, in main ipc_modem = IpcModem() File "[...]/scripts/src/tools/../../../tools/ipc-modem.py", line 39, in __init__ ipc_modem = sh.Command(srcdir + os.sep + 'ipc-modem') File "/usr/lib/python3.9/site-packages/sh.py", line 1342, in __init__ raise CommandNotFound(path) sh.CommandNotFound: ../../../tools/ipc-modem FAIL ipc-modem.py (exit status: 1) Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
-rwxr-xr-xtools/ipc-modem.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/ipc-modem.py b/tools/ipc-modem.py
index 0fcd1fc..52361eb 100755
--- a/tools/ipc-modem.py
+++ b/tools/ipc-modem.py
@@ -32,11 +32,17 @@ def get_output(data):
class IpcModem(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])
- ipc_modem = sh.Command(srcdir + os.sep + 'ipc-modem')
+ command_path = ''
+ if srcdir:
+ command_path = '.' + os.sep + 'ipc-modem'
+ # Enable to run tests without automake
+ else:
+ command_path = os.path.dirname(sys.argv[0]) \
+ + os.sep \
+ + 'ipc-modem'
+
+ ipc_modem = sh.Command(command_path)
self.ipc_modem = ipc_modem.bake('--dry-run')
def test_help(self):