diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2017-04-01 16:20:48 +0100 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2017-04-01 16:22:31 +0100 |
commit | 9642e81c73093e4dde11f8c047a41771b884e3d7 (patch) | |
tree | 9f23692d5ea728eb1a7bf5031ce81d4d0645e2ab /json-glib | |
parent | 59762fabeae64f9b80993729ef38df730686a3f8 (diff) | |
download | json-glib-9642e81c73093e4dde11f8c047a41771b884e3d7.tar.gz |
build: Don't copy test data in the build directory
GTest can use environment variables to find the test data in the source
and build directory, so we don't need to copy files around using Python
scripts.
Diffstat (limited to 'json-glib')
-rw-r--r-- | json-glib/tests/meson.build | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/json-glib/tests/meson.build b/json-glib/tests/meson.build index 1e6fbd7..eaa81a3 100644 --- a/json-glib/tests/meson.build +++ b/json-glib/tests/meson.build @@ -22,14 +22,6 @@ test_data = [ 'stream-load.json', ] -foreach d: test_data - copy = 'from shutil import copyfile; copyfile("@0@", "@1@")'.format(d, join_paths(meson.current_build_dir(), d)) - cp = run_command(python3, '-c', copy) - if cp.returncode() != 0 - error('Could not copy file: ' + cp.stderr()) - endif -endforeach - installed_test_dir = join_paths(json_libexecdir, 'installed-tests', 'json-glib-1.0') install_data(test_data, install_dir: installed_test_dir) @@ -54,5 +46,10 @@ foreach t: tests install_dir: installed_test_dir, dependencies: [ json_glib_dep, ]) - test(t, exe, args: [ '--tap', '-k' ]) + test(t, exe, + args: [ '--tap', '-k' ], + env: [ + 'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()), + 'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()), + ]) endforeach |