From 42bbd6ce89055b5963796ee54e101f6227314e74 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Tue, 17 Jul 2018 14:54:29 +0200 Subject: meson: Consolite vars used for running tracker-store uninstalled Most importantly, these are consumed in the tracker-miners.git project so that it can run when built with tracker core as a Meson subproject. This should theoretically allow building tracker-miners on systems that don't have tracker installed at all, although I think some problems remain with doing that. Note that meson.source_root() must never be used in variables that are consumed by a subproject, because in that situation they expand to the root of the *toplevel project* and not the current subproject. --- meson.build | 4 ++++ tests/functional-tests/ipc/meson.build | 4 ++-- tests/functional-tests/meson.build | 9 +++------ tests/libtracker-sparql/meson.build | 4 ++-- tests/tracker-steroids/meson.build | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/meson.build b/meson.build index 0a5c4beee..bd01118e6 100644 --- a/meson.build +++ b/meson.build @@ -325,6 +325,10 @@ test_c_args = tracker_c_args + [ '-DTOP_SRCDIR="@0@"'.format(source_root), ] +tracker_uninstalled_domain_rule = join_paths(meson.current_source_dir(), 'src', 'tracker-store', 'default.rule') +tracker_uninstalled_nepomuk_ontologies_dir = join_paths(meson.current_source_dir(), 'src', 'ontologies', 'nepomuk') +tracker_uninstalled_stop_words_dir = join_paths(meson.current_source_dir(), 'src', 'libtracker-common', 'stop-words') + subdir('tests') subdir('po') diff --git a/tests/functional-tests/ipc/meson.build b/tests/functional-tests/ipc/meson.build index e0bbe4da6..bd5a1611e 100644 --- a/tests/functional-tests/ipc/meson.build +++ b/tests/functional-tests/ipc/meson.build @@ -1,6 +1,6 @@ functional_ipc_test_c_args = [ - '-DTEST_DOMAIN_ONTOLOGY_RULE="@0@/src/tracker-store/default.rule"'.format(source_root), - '-DTEST_ONTOLOGIES_DIR="@0@/src/ontologies/nepomuk"'.format(source_root), + '-DTEST_DOMAIN_ONTOLOGY_RULE="@0@"'.format(tracker_uninstalled_domain_rule), + '-DTEST_ONTOLOGIES_DIR="@0@"'.format(tracker_uninstalled_nepomuk_ontologies_dir), ] insert_or_replace_test = executable('test-insert-or-replace', diff --git a/tests/functional-tests/meson.build b/tests/functional-tests/meson.build index d7b25cd26..c08c87507 100644 --- a/tests/functional-tests/meson.build +++ b/tests/functional-tests/meson.build @@ -34,18 +34,15 @@ functional_tests_with_test_data = [ config_json_full_path = join_paths(meson.current_build_dir(), 'configuration.json') dconf_profile_full_path = join_paths(meson.current_source_dir(), 'trackertest') -tracker_nepomuk_ontologies = join_paths(meson.current_source_dir(), '..', '..', 'src', 'ontologies', 'nepomuk') -tracker_stop_words_dir = join_paths(meson.current_source_dir(), '..', '..', 'src', 'libtracker-common', 'stop-words') -tracker_test_domain_ontology = join_paths(meson.current_source_dir(), '..', '..', 'src', 'tracker-store', 'default.rule') test_env = environment() test_env.set('DCONF_PROFILE', dconf_profile_full_path) -test_env.set('TRACKER_DB_ONTOLOGIES_DIR', tracker_nepomuk_ontologies) +test_env.set('TRACKER_DB_ONTOLOGIES_DIR', tracker_uninstalled_nepomuk_ontologies_dir) test_env.set('TRACKER_FUNCTIONAL_TEST_BUILD_DIR', build_root) test_env.set('TRACKER_FUNCTIONAL_TEST_CONFIG', config_json_full_path) -test_env.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', tracker_stop_words_dir) -test_env.set('TRACKER_TEST_DOMAIN_ONTOLOGY_RULE', tracker_test_domain_ontology) +test_env.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', tracker_uninstalled_stop_words_dir) +test_env.set('TRACKER_TEST_DOMAIN_ONTOLOGY_RULE', tracker_uninstalled_domain_rule) foreach t: functional_tests + functional_tests_with_test_data test('functional-' + t, test_runner, diff --git a/tests/libtracker-sparql/meson.build b/tests/libtracker-sparql/meson.build index 49b28bc98..aec51fdc7 100644 --- a/tests/libtracker-sparql/meson.build +++ b/tests/libtracker-sparql/meson.build @@ -5,8 +5,8 @@ libtracker_sparql_tests = [ libtracker_sparql_test_c_args = tracker_c_args + [ '-DTEST', - '-DTEST_DOMAIN_ONTOLOGY_RULE="@0@/src/tracker-store/default.rule"'.format(source_root), - '-DTEST_ONTOLOGIES_DIR="@0@/src/ontologies/nepomuk"'.format(source_root), + '-DTEST_DOMAIN_ONTOLOGY_RULE="@0@"'.format(tracker_uninstalled_domain_rule), + '-DTEST_ONTOLOGIES_DIR="@0@"'.format(tracker_uninstalled_nepomuk_ontologies_dir), ] libtracker_sparql_test_deps = [ diff --git a/tests/tracker-steroids/meson.build b/tests/tracker-steroids/meson.build index d8e780685..1330fe3d6 100644 --- a/tests/tracker-steroids/meson.build +++ b/tests/tracker-steroids/meson.build @@ -1,6 +1,6 @@ test_c_args = [ - '-DTEST_DOMAIN_ONTOLOGY_RULE="@0@/src/tracker-store/default.rule"'.format(meson.source_root()), - '-DTEST_ONTOLOGIES_DIR="@0@/src/ontologies/nepomuk"'.format(meson.source_root()), + '-DTEST_DOMAIN_ONTOLOGY_RULE="@0@"'.format(tracker_uninstalled_domain_rule), + '-DTEST_ONTOLOGIES_DIR="@0@"'.format(tracker_uninstalled_nepomuk_ontologies_dir), ] steroids_test = executable('tracker-steroids-test', -- cgit v1.2.1