summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam@afuera.me.uk>2019-09-28 14:44:07 +0200
committerSam Thursfield <sam@afuera.me.uk>2019-10-02 22:12:11 +0200
commit658b9451bc69646615c56d7ec522d2f39d6c6cdc (patch)
tree913a81ea6d1dc4e56cd469c199f9241c2deb995f
parent10c246d6da2ce7a9e60bc168b7d0a08565e1d7b0 (diff)
downloadtracker-658b9451bc69646615c56d7ec522d2f39d6c6cdc.tar.gz
utils/trackertestutils: Make it usable by other projects
This commit makes the tracker-testutils-2.0 package more reusable. The idea is that projects using Tracker can use this as a way to sandbox their test suites from the user's real Tracker data. In your meson.build file you would do something like this to locate the script and run your test. python3 = find_program('python3') trackertestutils = dependency('tracker-testutils-2.0') tracker_sandbox_command = find_program(trackertestutils.get_pkgconfig_variable('command')) test('myapptest', tracker_sandbox_command, args: ['--index-tmpdir', my_app_test_executable]) This would ensure that XDG_CACHE_HOME and XDG_DATA_HOME point to a temporary directory, separate from any real Tracker index data that the current user might have inside their XDG cache & data directories.
-rw-r--r--utils/trackertestutils/meson.build1
-rwxr-xr-xutils/trackertestutils/tracker-sandbox.in5
2 files changed, 6 insertions, 0 deletions
diff --git a/utils/trackertestutils/meson.build b/utils/trackertestutils/meson.build
index e8ab94c72..e7271fc86 100644
--- a/utils/trackertestutils/meson.build
+++ b/utils/trackertestutils/meson.build
@@ -1,5 +1,6 @@
sources = [
'__init__.py',
+ '__main__.py',
'dbusdaemon.py',
'dconf.py',
'helpers.py',
diff --git a/utils/trackertestutils/tracker-sandbox.in b/utils/trackertestutils/tracker-sandbox.in
new file mode 100755
index 000000000..4c47755a0
--- /dev/null
+++ b/utils/trackertestutils/tracker-sandbox.in
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+export PYTHONPATH=@testutils_dir@
+
+python3 -m trackertestutils --prefix=@prefix@ $@