summaryrefslogtreecommitdiff
path: root/json-glib
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-04-01 16:20:48 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2017-04-01 16:24:23 +0100
commitb094612b5334a9a9d5359f3cc6c8fabb5f926c97 (patch)
treefc8bc9f4b3846824e3131f4fa2f1227cf165e809 /json-glib
parentfdae08b4ff1addcc786aa572a2e3282b38e3b145 (diff)
downloadjson-glib-1-2.tar.gz
build: Don't copy test data in the build directoryjson-glib-1-2
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 <ebassi@gnome.org>
Diffstat (limited to 'json-glib')
-rw-r--r--json-glib/tests/meson.build15
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