[tracker/wip/sam/meson-functional-tests: 5/10] functional-tests: Support running uninstalled from source tree with Meson



commit 63cc54e377348144c5dce45e6e2f5f3369e63315
Author: Sam Thursfield <sam thursfield codethink co uk>
Date:   Wed Nov 1 14:50:54 2017 +0000

    functional-tests: Support running uninstalled from source tree with Meson

 tests/functional-tests/common/utils/helpers.py   |   13 ++++++++++++-
 tests/functional-tests/configuration/meson.build |    5 +++++
 2 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/tests/functional-tests/common/utils/helpers.py b/tests/functional-tests/common/utils/helpers.py
index d085e26..38458cc 100644
--- a/tests/functional-tests/common/utils/helpers.py
+++ b/tests/functional-tests/common/utils/helpers.py
@@ -32,6 +32,8 @@ import options
 class NoMetadataException (Exception):
     pass
 
+BUILD_DIR = os.environ.get('TRACKER_FUNCTIONAL_TEST_BUILD_DIR')
+
 REASONABLE_TIMEOUT = 30
 
 def log (message):
@@ -93,7 +95,11 @@ class Helper:
 
         command = [path] + flags
         log ("Starting %s" % ' '.join(command))
-        return subprocess.Popen ([path] + flags, **kws)
+        try:
+            process = subprocess.Popen (command, **kws)
+        except OSError as e:
+            raise RuntimeError("Unable to start %s: %s" % (' '.join(command), e))
+        return process
 
     def _bus_name_appeared(self, name, owner, data):
         log ("[%s] appeared in the bus as %s" % (self.PROCESS_NAME, owner))
@@ -214,6 +220,11 @@ class StoreHelper (Helper):
     PROCESS_NAME = "tracker-store"
     BUS_NAME = cfg.TRACKER_BUSNAME
 
+    if BUILD_DIR:
+        PROCESS_PATH = os.path.join (BUILD_DIR, "src", "tracker-store", "tracker-store")
+    else:
+        PROCESS_PATH = os.path.join (cfg.EXEC_PREFIX, "tracker-store")
+
     graph_updated_handler_id = 0
 
     def start (self):
diff --git a/tests/functional-tests/configuration/meson.build 
b/tests/functional-tests/configuration/meson.build
new file mode 100644
index 0000000..fb5d7a0
--- /dev/null
+++ b/tests/functional-tests/configuration/meson.build
@@ -0,0 +1,5 @@
+configure_file(
+  input: '__init__.py.in',
+  output: '__init__.py',
+  configuration: conf
+)


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