diff options
author | Daniele Nicolodi <daniele@grinta.net> | 2021-04-18 13:54:18 +0200 |
---|---|---|
committer | Daniele Nicolodi <daniele@grinta.net> | 2021-04-19 16:32:20 +0200 |
commit | 51ca035697a4cdbf8bf6849cc67dc8d462358a05 (patch) | |
tree | 98f578c16e551fd2e3c254568a6687a3fe23597a /examples | |
parent | eff23876125d13bb2819a70f21efdee1b06b166f (diff) | |
download | tracker-51ca035697a4cdbf8bf6849cc67dc8d462358a05.tar.gz |
Make tracker:endpoint test work on macOS
The symptom on my system are that the test fails to run because gi
cannot find the shared library object for Tracker. This is due to the
fact that $LD_LIBRARY_PATH is set by Meson but removed from the
environment by the time the test is running. This is because the
examples/python/endpoint.py scripts which uses '!#/usr/bin/env python'
as a shebang and on macOS the env utility removes dynamic linker
variables from the environment. Fix this by explicitly using python to
execute the script.
Use this opportunity for restructure how the Python installation and
executable is looked up in the build definition: use the 'python'
Meson module to lock for a suitable python in the main meson.build.
Also, the test setup does not set $TRACKER_LANGUAGE_STOP_WORDS_DIR to
point to the stop words directory in the source directory. Fix it.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/python/meson.build | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/python/meson.build b/examples/python/meson.build index 39c464520..47bac5af0 100644 --- a/examples/python/meson.build +++ b/examples/python/meson.build @@ -1,13 +1,14 @@ -python = find_program('python3') - env = environment() env.prepend('GI_TYPELIB_PATH', tracker_sparql_uninstalled_dir) env.prepend('LD_LIBRARY_PATH', tracker_sparql_uninstalled_dir) env.prepend('PYTHONPATH', tracker_uninstalled_testutils_dir) env.set('TRACKER_EXAMPLES_AUTOMATED_TEST', '1') env.set('TEST_ONTOLOGIES_DIR', tracker_uninstalled_nepomuk_ontologies_dir) +env.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', join_paths(source_root, 'src', 'libtracker-common', 'stop-words')) -sandbox_python_args = ['-m', 'trackertestutils', '--store-tmpdir', '--dbus-config', meson.current_build_dir() / '..' / '..' / 'tests' / 'test-bus.conf'] +sandbox_python_args = ['-m', 'trackertestutils', + '--store-tmpdir', + '--dbus-config', meson.current_build_dir() / '..' / '..' / 'tests' / 'test-bus.conf'] examples = [ 'endpoint', @@ -16,7 +17,7 @@ examples = [ foreach example_name: examples file = meson.current_source_dir() / '@0@.py'.format(example_name) test(example_name, python, - args: sandbox_python_args + [file], + args: sandbox_python_args + [python.path(), file], env: env, suite: 'examples') endforeach |