[gtk+] Fix test environments



commit 4a22704d82d5245cec9321b906941282fc714595
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Oct 18 16:55:02 2017 +0800

    Fix test environments

 testsuite/a11y/meson.build       |   14 ++++++++++----
 testsuite/css/meson.build        |    8 +++++++-
 testsuite/css/nodes/meson.build  |    9 +++++++--
 testsuite/css/parser/meson.build |    8 +++++++-
 testsuite/css/style/meson.build  |    8 +++++++-
 testsuite/gdk/meson.build        |    8 +++++++-
 testsuite/gsk/meson.build        |   30 +++++++++++++++++++-----------
 testsuite/gtk/meson.build        |   16 ++++++++++++++--
 testsuite/meson.build            |    9 ---------
 testsuite/tools/meson.build      |   12 +++++++++---
 10 files changed, 87 insertions(+), 35 deletions(-)
---
diff --git a/testsuite/a11y/meson.build b/testsuite/a11y/meson.build
index 8950e6f..164eda4 100644
--- a/testsuite/a11y/meson.build
+++ b/testsuite/a11y/meson.build
@@ -1,3 +1,6 @@
+testexecdir = join_paths(installed_test_bindir, 'a11y')
+testdatadir = join_paths(installed_test_datadir, 'a11y')
+
 a11y_tests = [
   'accessibility-dump',
   'tree-performance',
@@ -10,9 +13,6 @@ a11y_tests = [
   'util',
 ]
 
-testexecdir = join_paths(installed_test_bindir, 'a11y')
-testdatadir = join_paths(installed_test_datadir, 'a11y')
-
 foreach t: a11y_tests
   test_prefix = 'a11y'
 
@@ -22,7 +22,13 @@ foreach t: a11y_tests
                     install_dir: testexecdir,
                     dependencies: libgtk_dep),
         args: [ '--tap', '-k', ],
-        env: installed_test_env,
+        env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+               'GSETTINGS_BACKEND=memory',
+               'GTK_CSD=1',
+               'G_ENABLE_DIAGNOSTIC=0',
+               'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+               'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
+             ],
         suite: 'a11y')
 endforeach
 
diff --git a/testsuite/css/meson.build b/testsuite/css/meson.build
index 5329708..077cb7d 100644
--- a/testsuite/css/meson.build
+++ b/testsuite/css/meson.build
@@ -11,7 +11,13 @@ test_api = executable('api', 'api.c',
                       install_dir: testexecdir)
 test('api', test_api,
      args: ['--tap', '-k' ],
-     env: installed_test_env,
+     env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+            'GSETTINGS_BACKEND=memory',
+            'GTK_CSD=1',
+            'G_ENABLE_DIAGNOSTIC=0',
+            'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+            'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
+          ],
      suite: 'css')
 
 if get_option('install-tests')
diff --git a/testsuite/css/nodes/meson.build b/testsuite/css/nodes/meson.build
index 0ce567e..67abd86 100644
--- a/testsuite/css/nodes/meson.build
+++ b/testsuite/css/nodes/meson.build
@@ -1,14 +1,19 @@
 testexecdir = join_paths(installed_test_bindir, 'css', 'nodes')
 testdatadir = join_paths(installed_test_datadir, 'css')
 
-testexecdir = join_paths(installed_test_bindir, 'css', 'nodes')
 test_nodes = executable('test-css-nodes', 'test-css-nodes.c',
                         install: get_option('install-tests'),
                         install_dir: testexecdir,
                         dependencies: libgtk_dep)
 test('nodes', test_nodes,
      args: [ '--tap', '-k' ],
-     env: installed_test_env,
+     env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+            'GSETTINGS_BACKEND=memory',
+            'GTK_CSD=1',
+            'G_ENABLE_DIAGNOSTIC=0',
+            'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+            'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
+          ],
      suite: 'css')
 
 test_data = [
diff --git a/testsuite/css/parser/meson.build b/testsuite/css/parser/meson.build
index ac91b6c..9be1fdf 100644
--- a/testsuite/css/parser/meson.build
+++ b/testsuite/css/parser/meson.build
@@ -7,7 +7,13 @@ test_parser = executable('test-css-parser', 'test-css-parser.c',
                          dependencies: libgtk_dep)
 test('parser', test_parser,
      args: [ '--tap', '-k' ],
-     env: installed_test_env,
+     env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+            'GSETTINGS_BACKEND=memory',
+            'GTK_CSD=1',
+            'G_ENABLE_DIAGNOSTIC=0',
+            'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+             'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
+          ],
      suite: 'css')
 
 test_data = [
diff --git a/testsuite/css/style/meson.build b/testsuite/css/style/meson.build
index 5c84c02..fa2515f 100644
--- a/testsuite/css/style/meson.build
+++ b/testsuite/css/style/meson.build
@@ -17,7 +17,13 @@ test_style = executable(
 )
 test('style', test_style,
      args: [ '--tap', '-k' ],
-     env: installed_test_env,
+     env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+            'GSETTINGS_BACKEND=memory',
+            'GTK_CSD=1',
+            'G_ENABLE_DIAGNOSTIC=0',
+            'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+            'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
+          ],
      suite: 'css')
 
 test_data = [
diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build
index 84b503d..df60341 100644
--- a/testsuite/gdk/meson.build
+++ b/testsuite/gdk/meson.build
@@ -20,7 +20,13 @@ foreach t : tests
 
   test(t, test_exe,
        args: [ '--tap', '-k' ],
-       env: installed_test_env,
+       env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+              'GSETTINGS_BACKEND=memory',
+              'GTK_CSD=1',
+              'G_ENABLE_DIAGNOSTIC=0',
+              'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+              'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
+            ],
        suite: 'gdk')
 
   if get_option('install-tests')
diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build
index 7b932d3..8e4e397 100644
--- a/testsuite/gsk/meson.build
+++ b/testsuite/gsk/meson.build
@@ -10,28 +10,36 @@ test_render_nodes = executable(
   install_dir: testexecdir
 )
 
-cairo_test_env = environment()
-cairo_test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
-cairo_test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
-cairo_test_env.set('GSETTINGS_BACKEND', 'memory')
-cairo_test_env.set('G_ENABLE_DIAGNOSTIC', '0')
-cairo_test_env.set('GSK_RENDERER', 'cairo')
-
 test('nodes (cairo)', test_render_nodes,
-             args: [ '--tap', '-k' ],
-             env: cairo_test_env,
-             suite: 'gsk')
+     args: [ '--tap', '-k' ],
+     env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+            'GSETTINGS_BACKEND=memory',
+            'GTK_CSD=1',
+            'G_ENABLE_DIAGNOSTIC=0',
+            'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+            'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
+            'GSK_RENDERER=cairo'
+          ],
+     suite: 'gsk')
 
 vulkan_test_env = environment()
 vulkan_test_env.set('G_TEST_SRCDIR', meson.current_source_dir())
 vulkan_test_env.set('G_TEST_BUILDDIR', meson.current_build_dir())
 vulkan_test_env.set('GSETTINGS_BACKEND', 'memory')
+vulkan_test_env.set('GTK_CSD', '1')
 vulkan_test_env.set('G_ENABLE_DIAGNOSTIC', '0')
 vulkan_test_env.set('GSK_RENDERER', 'vulkan')
 
 test('nodes (vulkan)', test_render_nodes,
      args: [ '--tap', '-k' ],
-     env: vulkan_test_env,
+     env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+            'GSETTINGS_BACKEND=memory',
+            'GTK_CSD=1',
+            'G_ENABLE_DIAGNOSTIC=0',
+            'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+            'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
+            'GSK_RENDERER=vulkan'
+          ],
      suite: 'gsk')
 
 test_data = [
diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build
index 1c91d19..dab8a50 100644
--- a/testsuite/gtk/meson.build
+++ b/testsuite/gtk/meson.build
@@ -76,7 +76,13 @@ foreach t : tests
 
   test(test_name, test_exe,
        args: [ '--tap', '-k' ],
-       env: installed_test_env,
+       env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+              'GSETTINGS_BACKEND=memory',
+              'GTK_CSD=1',
+              'G_ENABLE_DIAGNOSTIC=0',
+              'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+              'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
+            ],
        suite: 'gtk')
 endforeach
 
@@ -90,7 +96,13 @@ if add_languages('cpp')
                         install_dir: testexecdir)
   test('c++ keywords', test_exe,
        args: [ '--tap', '-k' ],
-       env: installed_test_env,
+       env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+              'GSETTINGS_BACKEND=memory',
+              'GTK_CSD=1',
+              'G_ENABLE_DIAGNOSTIC=0',
+              'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+              'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir())
+            ],
        suite: 'gtk')
   if get_option('install-tests')
     conf = configuration_data()
diff --git a/testsuite/meson.build b/testsuite/meson.build
index fa283dd..f966e76 100644
--- a/testsuite/meson.build
+++ b/testsuite/meson.build
@@ -2,15 +2,6 @@ gtk_libexecdir = join_paths(gtk_prefix, get_option('libexecdir'))
 installed_test_bindir = join_paths(gtk_libexecdir, 'installed-tests', 'gtk-4.0')
 installed_test_datadir = join_paths(gtk_datadir, 'installed-tests', 'gtk-4.0')
 
-installed_test_env = [
-  'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
-  'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
-  'GIO_USE_VOLUME_MONITOR=unix',
-  'GSETTINGS_BACKEND=memory',
-  'GTK_CSD=1',
-  'G_ENABLE_DIAGNOSTIC=0',
-]
-
 subdir('gdk')
 subdir('gsk')
 subdir('gtk')
diff --git a/testsuite/tools/meson.build b/testsuite/tools/meson.build
index 64724d2..cfce7a3 100644
--- a/testsuite/tools/meson.build
+++ b/testsuite/tools/meson.build
@@ -4,8 +4,6 @@ testdatadir = join_paths(installed_test_datadir, 'tools')
 bash = find_program('bash', required : false)
 if bash.found()
   test_env = environment()
-  test_env.set('GTK_BUILDER_TOOL', get_variable('gtk4_builder_tool').full_path())
-  test_env.set('GTK_QUERY_SETTINGS', get_variable('gtk4_query_settings').full_path())
 
   foreach t : ['simplify', 'settings']
     configure_file(output: t,
@@ -16,7 +14,15 @@ if bash.found()
     test(t, bash,
          args: 'test-@0@'.format(t),
          workdir: meson.current_build_dir(),
-         env: test_env,
+         env: [ 'GIO_USE_VOLUME_MONITOR=unix',
+                'GSETTINGS_BACKEND=memory',
+                'GTK_CSD=1',
+                'G_ENABLE_DIAGNOSTIC=0',
+                'G_TEST_SRCDIR=@0@'.format(meson.current_source_dir()),
+                'G_TEST_BUILDDIR=@0@'.format(meson.current_build_dir()),
+                'GTK_BUILDER_TOOL=@0@'.format(get_variable('gtk4_builder_tool').full_path()),
+                'GTK_QUERY_SETTINGS=@0@'.format(get_variable('gtk4_query_settings').full_path())
+              ],
          suite: 'tools')
   endforeach
 endif


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