diff options
author | Sam Thursfield <sam@afuera.me.uk> | 2018-07-16 15:09:21 +0200 |
---|---|---|
committer | Sam Thursfield <sam@afuera.me.uk> | 2018-07-16 16:26:57 +0200 |
commit | 83e55a8d7eda1769c68230fbc5da408f8b39d282 (patch) | |
tree | 03343070b0ce06b16f076235f8100e46726dd9a8 | |
parent | abd2785aa1320209ac2fb88f88318327e6182529 (diff) | |
download | tracker-83e55a8d7eda1769c68230fbc5da408f8b39d282.tar.gz |
functional-tests: Autotools now runs functional tests against source tree
This is how Meson already behaves.
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | tests/functional-tests/Makefile.am | 10 | ||||
-rw-r--r-- | tests/functional-tests/common/utils/configuration.py | 13 |
3 files changed, 19 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac index 97fe99f19..a5ca8abf0 100644 --- a/configure.ac +++ b/configure.ac @@ -445,8 +445,8 @@ 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") +AC_SUBST(FUNCTIONAL_TESTS_ONTOLOGIES_DIR, "@top_srcdir@/tests/functional-tests/test-ontologies") +AC_SUBST(FUNCTIONAL_TESTS_TRACKER_STORE_PATH, "@top_builddir@/src/tracker-store/tracker-store") #################################################################### # Check for gtk-doc and docbook-tools diff --git a/tests/functional-tests/Makefile.am b/tests/functional-tests/Makefile.am index c12a47d4c..08082702d 100644 --- a/tests/functional-tests/Makefile.am +++ b/tests/functional-tests/Makefile.am @@ -51,13 +51,21 @@ TEST_RUNNER = $(top_srcdir)/tests/functional-tests/test-runner.sh functional-test: ${standard_tests} for test in ${standard_tests} ; do \ + export TRACKER_DB_ONTOLOGIES_DIR=$(top_srcdir)/src/ontologies/nepomuk; \ + export TRACKER_FUNCTIONAL_TEST_BUILD_DIR=$(top_builddir) ; \ export TRACKER_FUNCTIONAL_TEST_CONFIG=$(top_builddir)/tests/functional-tests/configuration.json ; \ + export TRACKER_LANGUAGE_STOP_WORDS_DIR=$(top_srcdir)/src/libtracker-common/stop-words ; \ + export TRACKER_TEST_DOMAIN_ONTOLOGY_RULE=$(top_srcdir)/src/tracker-store/default.rule ; \ $(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 \ + export TRACKER_DB_ONTOLOGIES_DIR=$(top_srcdir)/src/ontologies/nepomuk; \ + export TRACKER_FUNCTIONAL_TEST_BUILD_DIR=$(top_builddir) ; \ + export TRACKER_FUNCTIONAL_TEST_CONFIG=$(top_builddir)/tests/functional-tests/configuration.json ; \ + export TRACKER_LANGUAGE_STOP_WORDS_DIR=$(top_srcdir)/src/libtracker-common/stop-words ; \ + export TRACKER_TEST_DOMAIN_ONTOLOGY_RULE=$(top_srcdir)/src/tracker-store/default.rule ; \ $(TEST_RUNNER) python $(top_srcdir)/tests/functional-tests/$$test; \ done diff --git a/tests/functional-tests/common/utils/configuration.py b/tests/functional-tests/common/utils/configuration.py index 182bdcee2..c8a125bae 100644 --- a/tests/functional-tests/common/utils/configuration.py +++ b/tests/functional-tests/common/utils/configuration.py @@ -65,7 +65,9 @@ def expandvars (variable): result = variable for var, value in [("${datarootdir}", RAW_DATAROOT_DIR), ("${exec_prefix}", RAW_EXEC_PREFIX), - ("${prefix}", PREFIX)]: + ("${prefix}", PREFIX), + ("@top_srcdir@", TOP_SRCDIR), + ("@top_builddir@", TOP_BUILDDIR)]: result = result.replace (var, value) return result @@ -75,6 +77,9 @@ PREFIX = config['PREFIX'] RAW_EXEC_PREFIX = config['RAW_EXEC_PREFIX'] RAW_DATAROOT_DIR = config['RAW_DATAROOT_DIR'] +TOP_SRCDIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))) +TOP_BUILDDIR = os.environ['TRACKER_FUNCTIONAL_TEST_BUILD_DIR'] + TEST_ONTOLOGIES_DIR = os.path.normpath(expandvars(config['TEST_ONTOLOGIES_DIR'])) TRACKER_STORE_PATH = os.path.normpath(expandvars(config['TRACKER_STORE_PATH'])) @@ -94,10 +99,8 @@ if TEST_TMP_DIR.startswith('/tmp'): "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') + if TOP_BUILDDIR: + return os.path.join(TOP_BUILDDIR, 'tests', 'functional-tests', 'ttl') else: return 'ttl' |