diff options
-rw-r--r-- | configure.ac | 5 | ||||
-rw-r--r-- | meson.build | 16 | ||||
-rwxr-xr-x | tests/functional-tests/10-sqlite-misused.py | 27 | ||||
-rwxr-xr-x | tests/functional-tests/11-sqlite-batch-misused.py | 27 | ||||
-rwxr-xr-x | tests/functional-tests/13-threaded-store.py | 4 | ||||
-rwxr-xr-x | tests/functional-tests/17-ontology-changes.py | 11 | ||||
-rw-r--r-- | tests/functional-tests/Makefile.am | 4 | ||||
-rw-r--r-- | tests/functional-tests/common/utils/.gitignore | 1 | ||||
-rw-r--r-- | tests/functional-tests/common/utils/Makefile.am | 4 | ||||
-rw-r--r-- | tests/functional-tests/common/utils/configuration.py (renamed from tests/functional-tests/common/utils/configuration.py.in) | 45 | ||||
-rw-r--r-- | tests/functional-tests/common/utils/helpers.py | 13 | ||||
-rw-r--r-- | tests/functional-tests/common/utils/system.py | 5 | ||||
-rw-r--r-- | tests/functional-tests/configuration.json.in | 8 | ||||
-rw-r--r-- | tests/functional-tests/ipc/meson.build | 30 | ||||
-rw-r--r-- | tests/functional-tests/meson.build | 37 |
15 files changed, 156 insertions, 81 deletions
diff --git a/configure.ac b/configure.ac index 2098e7aaf..fa88b4b2a 100644 --- a/configure.ac +++ b/configure.ac @@ -443,6 +443,9 @@ fi AM_CONDITIONAL(DIST_FUNCTIONAL_TESTS, test "x$enable_functional_tests" != "xno") +AC_SUBST(FUNCTIONAL_TESTS_ONTOLOGIES_DIR, "${datadir}/tracker-tests/test-ontologies") +AC_SUBST(FUNCTIONAL_TESTS_TRACKER_STORE_PATH, "${libexecdir}/tracker-store") + #################################################################### # Check for gtk-doc and docbook-tools #################################################################### @@ -936,9 +939,9 @@ AC_CONFIG_FILES([ tests/libtracker-fts/prefix/Makefile tests/libtracker-sparql/Makefile tests/functional-tests/Makefile + tests/functional-tests/configuration.json tests/functional-tests/ipc/Makefile tests/functional-tests/common/Makefile - tests/functional-tests/common/utils/configuration.py tests/functional-tests/common/utils/Makefile tests/functional-tests/unittest2/Makefile tests/functional-tests/test-ontologies/Makefile 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) diff --git a/tests/functional-tests/10-sqlite-misused.py b/tests/functional-tests/10-sqlite-misused.py index e9203e3d6..0b7dc9d60 100755 --- a/tests/functional-tests/10-sqlite-misused.py +++ b/tests/functional-tests/10-sqlite-misused.py @@ -36,20 +36,24 @@ class TestSqliteMisused (CommonTrackerStoreTest): def setUp (self): self.main_loop = GObject.MainLoop () self.files_counter = 0 - + def test_queries_while_import (self): - self.assertTrue (os.path.exists ('ttl')) - for root, dirs, files in os.walk('ttl'): + assert os.path.isdir(cfg.generated_ttl_dir()) + + for root, dirs, files in os.walk(cfg.generated_ttl_dir()): for ttl_file in filter (lambda f: f.endswith (".ttl"), files): full_path = os.path.abspath(os.path.join (root, ttl_file)) self.files_counter += 1 - self.tracker.query( + + self.tracker.load( "file://" + full_path, timeout=30000, result_handler=self.loaded_success_cb, - error_handler=self.loaded_failed_cb) + error_handler=self.loaded_failed_cb, + user_data = full_path) GObject.timeout_add_seconds (2, self.run_a_query) # Safeguard of 60 seconds. The last reply should quit the loop + # It doesn't matter if we didn't import all of the files yet. GObject.timeout_add_seconds (60, self.timeout_cb) self.main_loop.run () @@ -64,19 +68,18 @@ class TestSqliteMisused (CommonTrackerStoreTest): def reply_cb (self, obj, results, data): print "Query replied correctly" - def error_handler (self, error_msg): - print "ERROR in DBus call", error_msg + def error_handler (self, obj, error, data): + print "ERROR in DBus call: %s" % error - def loaded_success_cb (self, obj, results, data): + def loaded_success_cb (self, obj, results, user_data): self.files_counter -= 1 if (self.files_counter == 0): print "Last file loaded" self.timeout_cb () - print "Success loading a file" + print "Success loading %s" % user_data - def loaded_failed_cb (self, error): - print "Failed loading a file" - self.assertTrue (False) + def loaded_failed_cb (self, obj, error, user_data): + raise RuntimeError("Failed loading %s: %s" % (user_data, error)) def timeout_cb (self): print "Forced timeout after 60 sec." diff --git a/tests/functional-tests/11-sqlite-batch-misused.py b/tests/functional-tests/11-sqlite-batch-misused.py index c4ef0be7e..cc810f2c8 100755 --- a/tests/functional-tests/11-sqlite-batch-misused.py +++ b/tests/functional-tests/11-sqlite-batch-misused.py @@ -41,11 +41,11 @@ class TestSqliteBatchMisused (CommonTrackerStoreTest): def setUp (self): self.main_loop = GObject.MainLoop () self.batch_counter = 0 - + def test_queries_while_batch_insert (self): - self.assertTrue (os.path.exists ('ttl')) - - for root, dirs, files in os.walk('ttl'): + self.assertTrue (os.path.exists (cfg.generated_ttl_dir())) + + for root, dirs, files in os.walk(cfg.generated_ttl_dir()): for ttl_file in filter (lambda f: f.endswith (".ttl"), files): full_path = os.path.abspath(os.path.join (root, ttl_file)) print full_path @@ -58,10 +58,10 @@ class TestSqliteBatchMisused (CommonTrackerStoreTest): current_batch += line if len(line) > 1 and line[:-1].endswith ('.'): counter += 1 - - if counter == BATCH_SIZE: + + if counter >= BATCH_SIZE: query = "INSERT {" + current_batch + "}" - self.tracker.batch_update( + token = self.tracker.batch_update( query, timeout=20000, result_handler=self.batch_success_cb, @@ -70,8 +70,7 @@ class TestSqliteBatchMisused (CommonTrackerStoreTest): counter = 0 current_batch = "" self.batch_counter += 1 - - + GObject.timeout_add_seconds (2, self.run_a_query) # Safeguard of 60 seconds. The last reply should quit the loop GObject.timeout_add_seconds (60, self.timeout_cb) @@ -84,22 +83,24 @@ class TestSqliteBatchMisused (CommonTrackerStoreTest): reply_handler=self.reply_cb, error_handler=self.error_handler) return True - + def reply_cb (self, obj, results, data): print "Query replied correctly" def error_handler (self, error_msg): print "Query failed", error_msg + raise error_msg - def batch_success_cb (self): + def batch_success_cb (self, obj, result, user_data): self.batch_counter -= 1 if (self.batch_counter == 0): print "Last batch was success" self.timeout_cb () print "Success processing a batch" - def batch_failed_cb (self, error): - print "Failed processing a batch" + def batch_failed_cb (self, obj, error, user_data): + print "Failed processing a batch: %s" % error + raise error def timeout_cb (self): print "Forced timeout after 60 sec." diff --git a/tests/functional-tests/13-threaded-store.py b/tests/functional-tests/13-threaded-store.py index 55d76c1e4..d24da782f 100755 --- a/tests/functional-tests/13-threaded-store.py +++ b/tests/functional-tests/13-threaded-store.py @@ -52,7 +52,7 @@ class TestThreadedStore (CommonTrackerStoreTest): def __populate_database (self): - self.assertTrue (os.path.exists ('ttl')) + self.assertTrue (os.path.exists (cfg.generated_ttl_dir())) for ttl_file in ["010-nco_EmailAddress.ttl", "011-nco_PostalAddress.ttl", "012-nco_PhoneNumber.ttl", @@ -61,7 +61,7 @@ class TestThreadedStore (CommonTrackerStoreTest): "018-nco_PersonContact.ttl", "012-nco_PhoneNumber.ttl", "016-nco_ContactIM.ttl"]: - full_path = os.path.abspath(os.path.join ("ttl", ttl_file)) + full_path = os.path.abspath(os.path.join (cfg.generated_ttl_dir(), ttl_file)) print full_path self.tracker.get_tracker_iface().Load( '(s)', "file://" + full_path, timeout=30000) diff --git a/tests/functional-tests/17-ontology-changes.py b/tests/functional-tests/17-ontology-changes.py index 8665a5dad..3a5581edf 100755 --- a/tests/functional-tests/17-ontology-changes.py +++ b/tests/functional-tests/17-ontology-changes.py @@ -62,19 +62,14 @@ class OntologyChangeTestTemplate (ut.TestCase): """ def get_ontology_dir (self, param): - local = os.path.join (os.getcwd (), "test-ontologies", param) - if (os.path.exists (local)): - # Use local directory if available - return local - else: - return os.path.join (cfg.DATADIR, "tracker-tests", - "test-ontologies", param) + return os.path.join(cfg.TEST_ONTOLOGIES_DIR, param) def setUp (self): self.system = TrackerSystemAbstraction () def tearDown (self): - self.system.tracker_store_testing_stop () + if self.system.store is not None: + self.system.tracker_store_testing_stop () def template_test_ontology_change (self): diff --git a/tests/functional-tests/Makefile.am b/tests/functional-tests/Makefile.am index db6225558..ddad7e0fe 100644 --- a/tests/functional-tests/Makefile.am +++ b/tests/functional-tests/Makefile.am @@ -8,6 +8,7 @@ SUBDIRS = \ configdir = $(datadir)/tracker-tests config_DATA = \ + configuration.json \ trackertest config_SCRIPTS = \ @@ -51,16 +52,19 @@ TEST_RUNNER = $(top_srcdir)/tests/functional-tests/test-runner.sh functional-test: ${standard_tests} for test in ${standard_tests} ; do \ + export TRACKER_FUNCTIONAL_TEST_CONFIG=$(top_builddir)/tests/functional-tests/configuration.json ; \ $(TEST_RUNNER) python $(top_srcdir)/tests/functional-tests/$$test; \ done functional-test-slow: ${slow_tests} @for test in ${slow_tests} ; do \ + export TRACKER_FUNCTIONAL_TEST_CONFIG=$(top_builddir)/tests/functional-tests/configuration.json \ $(TEST_RUNNER) python $(top_srcdir)/tests/functional-tests/$$test; \ done EXTRA_DIST = \ $(config_SCRIPTS) \ $(config_DATA) \ + configuration.json.in \ test-runner.sh \ meson.build diff --git a/tests/functional-tests/common/utils/.gitignore b/tests/functional-tests/common/utils/.gitignore deleted file mode 100644 index 7c0b74684..000000000 --- a/tests/functional-tests/common/utils/.gitignore +++ /dev/null @@ -1 +0,0 @@ -configuration.py diff --git a/tests/functional-tests/common/utils/Makefile.am b/tests/functional-tests/common/utils/Makefile.am index b32b781c9..2f989d5c9 100644 --- a/tests/functional-tests/common/utils/Makefile.am +++ b/tests/functional-tests/common/utils/Makefile.am @@ -10,6 +10,4 @@ utils_SCRIPTS = \ options.py \ system.py -EXTRA_DIST = \ - configuration.py.in \ - $(utils_SCRIPTS) +EXTRA_DIST = $(utils_SCRIPTS) diff --git a/tests/functional-tests/common/utils/configuration.py.in b/tests/functional-tests/common/utils/configuration.py index 6bc3b1b79..182bdcee2 100644 --- a/tests/functional-tests/common/utils/configuration.py.in +++ b/tests/functional-tests/common/utils/configuration.py @@ -20,8 +20,17 @@ "Constants describing Tracker D-Bus services" +import json import os +if 'TRACKER_FUNCTIONAL_TEST_CONFIG' not in os.environ: + raise RuntimeError("The TRACKER_FUNCTIONAL_TEST_CONFIG environment " + "variable must be set to point to the location of " + "the generated configuration.json file.") + +with open(os.environ['TRACKER_FUNCTIONAL_TEST_CONFIG']) as f: + config = json.load(f) + TRACKER_BUSNAME = 'org.freedesktop.Tracker1' TRACKER_OBJ_PATH = '/org/freedesktop/Tracker1/Resources' RESOURCES_IFACE = "org.freedesktop.Tracker1.Resources" @@ -32,7 +41,7 @@ MINER_IFACE = "org.freedesktop.Tracker1.Miner" MINERFS_INDEX_OBJ_PATH = "/org/freedesktop/Tracker1/Miner/Files/Index" MINER_INDEX_IFACE = "org.freedesktop.Tracker1.Miner.Files.Index" -TRACKER_BACKUP_OBJ_PATH = "/org/freedesktop/Tracker1/Backup" +TRACKER_BACKUP_OBJ_PATH = "/org/freedesktop/Tracker1/Backup" BACKUP_IFACE = "org.freedesktop.Tracker1.Backup" TRACKER_STATS_OBJ_PATH = "/org/freedesktop/Tracker1/Statistics" @@ -49,6 +58,8 @@ WRITEBACK_BUSNAME = "org.freedesktop.Tracker1.Writeback" DCONF_MINER_SCHEMA = "org.freedesktop.Tracker.Miner.Files" +# Autoconf substitutes paths in the configuration.json file without +# expanding variables, so we need to manually insert these. def expandvars (variable): # Note: the order matters! result = variable @@ -57,29 +68,18 @@ def expandvars (variable): ("${prefix}", PREFIX)]: result = result.replace (var, value) - return result +PREFIX = config['PREFIX'] +RAW_EXEC_PREFIX = config['RAW_EXEC_PREFIX'] +RAW_DATAROOT_DIR = config['RAW_DATAROOT_DIR'] -PREFIX = "@prefix@" -# -# This raw variables are set by autotools without translating vars: -# E.G. bindir='${exec_prefix}/bin -# -# So we do the translation by hand in the expandvars function -# -RAW_EXEC_PREFIX = "@exec_prefix@" -RAW_EXEC_DIR = "@libexecdir@" -RAW_DATA_DIR = "@datadir@" -RAW_DATAROOT_DIR = "@datarootdir@" -RAW_BINDIR = "@bindir@" +TEST_ONTOLOGIES_DIR = os.path.normpath(expandvars(config['TEST_ONTOLOGIES_DIR'])) -EXEC_PREFIX = os.path.normpath (expandvars (RAW_EXEC_DIR)) -DATADIR = os.path.normpath (expandvars (RAW_DATA_DIR)) -BINDIR = os.path.normpath (expandvars (RAW_BINDIR)) +TRACKER_STORE_PATH = os.path.normpath(expandvars(config['TRACKER_STORE_PATH'])) -disableJournal = ("@DISABLE_JOURNAL_TRUE@" == "") +disableJournal = (len(config['disableJournal']) == 0) TEST_TMP_DIR = os.path.join (os.environ["HOME"], "tracker-tests") @@ -92,3 +92,12 @@ if TEST_TMP_DIR.startswith('/tmp'): print ("HOME is in the /tmp prefix - this will cause tests that rely " + "on filesystem monitoring to fail as changes in that prefix are " + "ignored.") + + +BUILD_DIR = os.environ.get('TRACKER_FUNCTIONAL_TEST_BUILD_DIR') + +def generated_ttl_dir(): + if BUILD_DIR: + return os.path.join(BUILD_DIR, 'tests', 'functional-tests', 'ttl') + else: + return 'ttl' diff --git a/tests/functional-tests/common/utils/helpers.py b/tests/functional-tests/common/utils/helpers.py index d085e2697..95e48401b 100644 --- a/tests/functional-tests/common/utils/helpers.py +++ b/tests/functional-tests/common/utils/helpers.py @@ -78,9 +78,7 @@ class Helper: sys.excepthook = new_hook def _start_process (self): - path = getattr (self, - "PROCESS_PATH", - os.path.join (cfg.EXEC_PREFIX, self.PROCESS_NAME)) + path = self.PROCESS_PATH flags = getattr (self, "FLAGS", []) @@ -93,7 +91,10 @@ class Helper: command = [path] + flags log ("Starting %s" % ' '.join(command)) - return subprocess.Popen ([path] + flags, **kws) + try: + return subprocess.Popen ([path] + flags, **kws) + except OSError as e: + raise RuntimeError("Error starting %s: %s" % (path, e)) def _bus_name_appeared(self, name, owner, data): log ("[%s] appeared in the bus as %s" % (self.PROCESS_NAME, owner)) @@ -212,6 +213,7 @@ class StoreHelper (Helper): """ PROCESS_NAME = "tracker-store" + PROCESS_PATH = cfg.TRACKER_STORE_PATH BUS_NAME = cfg.TRACKER_BUSNAME graph_updated_handler_id = 0 @@ -469,6 +471,9 @@ class StoreHelper (Helper): def update (self, update_sparql, timeout=5000, **kwargs): return self.resources.SparqlUpdate ('(s)', update_sparql, timeout=timeout, **kwargs) + def load (self, ttl_uri, timeout=5000, **kwargs): + return self.resources.Load ('(s)', ttl_uri, timeout=timeout, **kwargs) + def batch_update (self, update_sparql, **kwargs): return self.resources.BatchSparqlUpdate ('(s)', update_sparql, **kwargs) diff --git a/tests/functional-tests/common/utils/system.py b/tests/functional-tests/common/utils/system.py index bf8433d24..3d15a3795 100644 --- a/tests/functional-tests/common/utils/system.py +++ b/tests/functional-tests/common/utils/system.py @@ -19,9 +19,7 @@ import helpers TEST_ENV_DIRS = { "XDG_DATA_HOME" : os.path.join (cfg.TEST_TMP_DIR, "data"), "XDG_CACHE_HOME": os.path.join (cfg.TEST_TMP_DIR, "cache")} -TEST_ENV_VARS = { "LC_COLLATE": "en_GB.utf8", - "DCONF_PROFILE": os.path.join (cfg.DATADIR, "tracker-tests", - "trackertest") } +TEST_ENV_VARS = { "LC_COLLATE": "en_GB.utf8" } EXTRA_DIRS = [os.path.join (cfg.TEST_TMP_DIR, "data", "tracker"), os.path.join (cfg.TEST_TMP_DIR, "cache", "tracker")] @@ -35,6 +33,7 @@ class UnableToBootException (Exception): class TrackerSystemAbstraction (object): def __init__(self, settings=None, ontodir=None): self.set_up_environment (settings=settings, ontodir=ontodir) + self.store = None def set_up_environment (self, settings=None, ontodir=None): """ diff --git a/tests/functional-tests/configuration.json.in b/tests/functional-tests/configuration.json.in new file mode 100644 index 000000000..06a5be195 --- /dev/null +++ b/tests/functional-tests/configuration.json.in @@ -0,0 +1,8 @@ +{ + "PREFIX": "@prefix@", + "RAW_EXEC_PREFIX": "@exec_prefix@", + "RAW_DATAROOT_DIR": "@datarootdir@", + "TEST_ONTOLOGIES_DIR": "@FUNCTIONAL_TESTS_ONTOLOGIES_DIR@", + "TRACKER_STORE_PATH": "@FUNCTIONAL_TESTS_TRACKER_STORE_PATH@", + "disableJournal": "@DISABLE_JOURNAL_TRUE@" +} diff --git a/tests/functional-tests/ipc/meson.build b/tests/functional-tests/ipc/meson.build index c458ac806..5b881604f 100644 --- a/tests/functional-tests/ipc/meson.build +++ b/tests/functional-tests/ipc/meson.build @@ -1,53 +1,63 @@ insert_or_replace_test = executable('test-insert-or-replace', 'test-insert-or-replace.vala', dependencies: [tracker_common_dep, tracker_sparql_dep]) -test('functional-ipc-insert-or-replace', insert_or_replace_test) +test('functional-ipc-insert-or-replace', insert_or_replace_test, + env: test_env) busy_handling_test = executable('test-busy-handling', 'test-busy-handling.vala', dependencies: [tracker_common_dep, tracker_sparql_dep]) -test('functional-ipc-busy-handling', busy_handling_test) +test('functional-ipc-busy-handling', busy_handling_test, + env: test_env) direct_query_test = executable('test-direct-query', 'test-direct-query.vala', 'test-shared-query.vala', dependencies: [tracker_common_dep, tracker_sparql_dep]) -test('functional-ipc-direct-query', direct_query_test) +test('functional-ipc-direct-query', direct_query_test, + env: test_env) bus_query_test = executable('test-bus-query', 'test-bus-query.vala', 'test-shared-query.vala', dependencies: [tracker_common_dep, tracker_sparql_dep, tracker_sparql_bus_dep]) -test('functional-ipc-bus-query', bus_query_test) +test('functional-ipc-bus-query', bus_query_test, + env: test_env) default_update_test = executable('test-default-update', 'test-default-update.vala', 'test-shared-update.vala', dependencies: [tracker_common_dep, tracker_sparql_dep]) -test('functional-ipc-default-update', default_update_test) +test('functional-ipc-default-update', default_update_test, + env: test_env) bus_update_test = executable('test-bus-update', 'test-bus-update.vala', 'test-shared-update.vala', dependencies: [tracker_common_dep, tracker_sparql_dep, tracker_sparql_bus_dep]) -test('functional-ipc-bus-update', bus_update_test) +test('functional-ipc-bus-update', bus_update_test, + env: test_env) class_signal_test = executable('test-class-signal', 'test-class-signal.vala', dependencies: [tracker_common_dep, tracker_sparql_dep]) -test('functional-ipc-class-signal', class_signal_test) +test('functional-ipc-class-signal', class_signal_test, + env: test_env) class_signal_performance_test = executable('test-class-signal-performance', 'test-class-signal-performance.vala', dependencies: [tracker_common_dep, tracker_sparql_dep]) -test('functional-ipc-class-signal-performance', class_signal_performance_test) +test('functional-ipc-class-signal-performance', class_signal_performance_test, + env: test_env) class_signal_performance_batch_test = executable('test-class-signal-performance-batch', 'test-class-signal-performance-batch.vala', dependencies: [tracker_common_dep, tracker_sparql_dep]) -test('functional-ipc-class-signal-performance-batch', class_signal_performance_batch_test) +test('functional-ipc-class-signal-performance-batch', class_signal_performance_batch_test, + env: test_env) update_array_performance_test = executable('test-update-array-performance', 'test-update-array-performance.c', dependencies: [tracker_common_dep, tracker_sparql_dep]) -test('functional-ipc-update-array-performance', update_array_performance_test) +test('functional-ipc-update-array-performance', update_array_performance_test, + env: test_env) diff --git a/tests/functional-tests/meson.build b/tests/functional-tests/meson.build index 8261e1427..57de81f4c 100644 --- a/tests/functional-tests/meson.build +++ b/tests/functional-tests/meson.build @@ -1,7 +1,11 @@ -subdir('ipc') - test_runner = find_program('test-runner.sh') +config_json = configure_file( + input: 'configuration.json.in', + output: 'configuration.json', + configuration: conf +) + functional_tests = [ '01-insertion', '02-sparql-bugs', @@ -12,10 +16,7 @@ functional_tests = [ '07-graph', '08-unique-insertions', '09-concurrent-query', - '10-sqlite-misused', - '11-sqlite-batch-misused', '12-transactions', - '13-threaded-store', '14-signals', '15-statistics', '16-collation', @@ -23,10 +24,34 @@ functional_tests = [ '200-backup-restore', ] -foreach t: functional_tests +subdir('ttl') +functional_tests_with_test_data = [ + '10-sqlite-misused', + '11-sqlite-batch-misused', + '13-threaded-store', +] + +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_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) + +foreach t: functional_tests + functional_tests_with_test_data test('functional-' + t, test_runner, args: './' + t + '.py', + env: test_env, workdir: meson.current_source_dir(), # FIXME: these tests are all too slow timeout: 180) endforeach + +subdir('ipc') |