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 <[email protected]>
---
 samsung-ipc/tests/libsamsung-ipc-test.py | 15 ++++++++++-----
 1 file 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)
-- 
2.34.1

_______________________________________________
Replicant mailing list
[email protected]
https://lists.osuosl.org/mailman/listinfo/replicant

Reply via email to