From b094612b5334a9a9d5359f3cc6c8fabb5f926c97 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 1 Apr 2017 16:20:48 +0100 Subject: 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. (cherry picked from commit 9642e81c73093e4dde11f8c047a41771b884e3d7) Signed-off-by: Emmanuele Bassi --- json-glib/tests/meson.build | 15 ++++++--------- 1 file 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 -- cgit v1.2.1