summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2017-11-01 18:05:50 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2017-12-18 18:40:33 +0000
commitd8cddb51fc8b4c341bb928674034b47fe1c0e723 (patch)
tree37cf81b52d6051a365dd13ee8f37538036ef35b0 /meson.build
parent7036a21d7dea0b5e53c6b751b5472d9f72082645 (diff)
downloadtracker-wip/sam/meson-functional-tests.tar.gz
functional-tests: Fix configuration to work with Mesonwip/sam/meson-functional-tests
Previously the functional-test suite would test the installed version of Tracker, but would need to be run from a configured Tracker source+build tree. I have changed how things are configured and now with Meson the functional tests can be run completely from the build tree, without needing to install anything. The Autotools `make functional-test` target works the same as before. Instead of generating a Python source file that contains the build-time configuration, we write that to a .json file which is read when the common.utils.configuration module is imported. This controls the locations of the various things that the tests require, which allows us to support any kind fo build tree layout. With the new setup it should also be possible to add a target that explicitly installs the functional tests, with a different configuration.json file such that they test the installed version of Tracker. That's not yet implemented.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 16 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 17173b2ef..e70e9e03a 100644
--- a/meson.build
+++ b/meson.build
@@ -223,6 +223,9 @@ conf.set('TRACKER_BINARY_AGE', 100 * tracker_minor_version + tracker_micro_versi
# Config that goes in some other generated files (.desktop, .pc, etc)
conf.set('exec_prefix', get_option('prefix'))
+conf.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
+conf.set('datadir', join_paths(get_option('prefix'), get_option('datadir')))
+conf.set('datarootdir', join_paths(get_option('prefix'), get_option('datadir')))
conf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
conf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
conf.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir')))
@@ -230,6 +233,19 @@ conf.set('prefix', get_option('prefix'))
conf.set('TRACKER_API_VERSION', tracker_api_version)
conf.set('VERSION', meson.project_version())
+# Configure functional tests to run completely from source tree.
+conf.set('FUNCTIONAL_TESTS_ONTOLOGIES_DIR', join_paths(meson.current_source_dir(), 'tests', 'functional-tests', 'test-ontologies'))
+conf.set('FUNCTIONAL_TESTS_TRACKER_STORE_PATH', join_paths(meson.current_build_dir(), 'src', 'tracker-store', 'tracker-store'))
+
+# This is set in an awkward way for compatibility with Autoconf. Switch it
+# to a normal boolean once we get rid of the Autotools build system. It's
+# only used in tests/functional-tests/common/utils/configuration.py.in.
+if get_option('journal')
+ conf.set('DISABLE_JOURNAL_TRUE', 'true')
+else
+ conf.set('DISABLE_JOURNAL_TRUE', '')
+endif
+
configure_file(input: 'config.h.meson.in',
output: 'config.h',
configuration: conf)