[gegl] tests: Make run-tests.py distcheck friendly



commit cf7a3a047aebd592a61506e90af9205521926141
Author: Daniel Sabo <DanielSabo gmail com>
Date:   Tue Nov 12 13:02:23 2013 -0800

    tests: Make run-tests.py distcheck friendly

 tests/Makefile.am  |    1 +
 tests/run-tests.py |    8 ++++++--
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index dc8f520..67485a6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,3 +1,4 @@
+EXTRA_DIST=run-tests.py
 
 SUBDIRS = \
        buffer \
diff --git a/tests/run-tests.py b/tests/run-tests.py
index 960ad24..63690bc 100755
--- a/tests/run-tests.py
+++ b/tests/run-tests.py
@@ -56,10 +56,14 @@ class Context():
     test_env["GEGL_SWAP"] = "RAM"
     test_env["GEGL_PATH"] = os.path.join(self.build_dir, "operations")
 
+    # When given a script Make will give us a path relative to the build directory, but the real
+    # path should be relative to the source directory.
     if test_name.endswith(".sh"):
-      test_exe = [SHELL, "./" + test_name]
+      test_path = os.path.realpath(os.path.join(self.src_dir, os.path.relpath(test_name, self.build_dir)))
+      test_exe = [SHELL, test_path]
     elif test_name.endswith(".py"):
-      test_exe = [PYTHON, "./" + test_name]
+      test_path = os.path.realpath(os.path.join(self.src_dir, os.path.relpath(test_name, self.build_dir)))
+      test_exe = [PYTHON, test_path]
     else:
       test_exe = ["./" + test_name]
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]