[json-glib] build: Don't copy test data in the build directory



commit 9642e81c73093e4dde11f8c047a41771b884e3d7
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Sat Apr 1 16:20:48 2017 +0100

    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.

 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]