From abe7d8a846d0b83a7534cc12f9fcfebaf8eab017 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 18 Oct 2017 02:50:05 +0800 Subject: [PATCH] More testsuite cosmetics Unify the test naming some more. --- testsuite/css/nodes/meson.build | 2 +- testsuite/css/parser/meson.build | 2 +- testsuite/css/style/meson.build | 2 +- testsuite/gdk/meson.build | 2 +- testsuite/gsk/meson.build | 43 ++++++++++++++++++++++++- testsuite/gsk/test-render-nodes.test.in | 4 +++ testsuite/gtk/meson.build | 4 +-- testsuite/tools/meson.build | 2 +- 8 files changed, 53 insertions(+), 8 deletions(-) create mode 100644 testsuite/gsk/test-render-nodes.test.in diff --git a/testsuite/css/nodes/meson.build b/testsuite/css/nodes/meson.build index 6c6612e169..ae9860839c 100644 --- a/testsuite/css/nodes/meson.build +++ b/testsuite/css/nodes/meson.build @@ -9,7 +9,7 @@ test_nodes = executable('test-css-nodes', 'test-css-nodes.c', install: get_option('install-tests'), install_dir: testexecdir, dependencies: libgtk_dep) -test('test-nodes', test_nodes, suite: 'css', env: test_env) +test('nodes', test_nodes, suite: 'css', env: test_env) test_data = [ 'box.ltr.nodes', diff --git a/testsuite/css/parser/meson.build b/testsuite/css/parser/meson.build index 8c5e3d444a..2c36e153f8 100644 --- a/testsuite/css/parser/meson.build +++ b/testsuite/css/parser/meson.build @@ -10,7 +10,7 @@ test_parser = executable('test-css-parser', 'test-css-parser.c', install: get_option('install-tests'), install_dir: testexecdir, dependencies: libgtk_dep) -test('css-parser', test_parser, suite: 'css', env: test_env) +test('parser', test_parser, suite: 'css', env: test_env) test_data = [ 'animation-crash-3.12.css', diff --git a/testsuite/css/style/meson.build b/testsuite/css/style/meson.build index 394bca11b5..79cd90a44a 100644 --- a/testsuite/css/style/meson.build +++ b/testsuite/css/style/meson.build @@ -20,7 +20,7 @@ test_style = executable( install_dir: testexecdir, dependencies: libgtk_dep, ) -test('test-style', test_style, suite: 'css', env: test_env) +test('style', test_style, suite: 'css', env: test_env) test_data = [ 'adjacent-states.css', diff --git a/testsuite/gdk/meson.build b/testsuite/gdk/meson.build index cc33a7b3b1..b74d654422 100644 --- a/testsuite/gdk/meson.build +++ b/testsuite/gdk/meson.build @@ -17,7 +17,7 @@ test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) foreach t : tests test_exe = executable(t, '@0@.c'.format(t), dependencies : libgtk_dep) - test('@0@ test'.format(t), test_exe, suite : 'gdk', env : test_env) + test(t, test_exe, suite : 'gdk', env : test_env) endforeach # TODO: installed tests + .test files diff --git a/testsuite/gsk/meson.build b/testsuite/gsk/meson.build index d5ad54d59c..b16d074c3b 100644 --- a/testsuite/gsk/meson.build +++ b/testsuite/gsk/meson.build @@ -1,7 +1,48 @@ +test_env = environment() +test_env.set('G_TEST_SRCDIR', meson.current_source_dir()) +test_env.set('G_TEST_BUILDDIR', meson.current_build_dir()) +test_env.set('GSETTINGS_BACKEND', 'memory') +test_env.set('G_ENABLE_DIAGNOSTIC', '0') + test_render_nodes = executable( 'test-render-nodes', ['test-render-nodes.c', 'reftest-compare.c'], dependencies: libgtk_dep, ) -test('test-render-nodes', test_render_nodes, suite: 'gsk') + +test('test-render-nodes', test_render_nodes, suite: 'gsk', env: test_env) + +test_data = [ + 'blendmode.node', + 'blendmode.png', + 'blendmodes.node', + 'blendmodes.png', + 'cairo.node', + 'cairo.png', + 'colors.cairo.png', + 'colors.node', + 'colors.vulkan.png', + 'cross-fade.node', + 'cross-fade.png', + 'cross-fades.node', + 'cross-fades.png', + 'ducky.png', + 'repeat.node', + 'repeat.png', + 'transform.node', + 'transform.png', +] + +if get_option('install-tests') + conf = configuration_data() + conf.set('libexecdir', gtk_libexecdir) + configure_file(input: 'test-render-nodes.test.in', + output: 'test-render-nodes.test', + configuration: conf, + install_dir: installed_test_datadir) + + install_data(test_data, install_dir: testexecdir) + +endif + diff --git a/testsuite/gsk/test-render-nodes.test.in b/testsuite/gsk/test-render-nodes.test.in new file mode 100644 index 0000000000..4ea3baa74b --- /dev/null +++ b/testsuite/gsk/test-render-nodes.test.in @@ -0,0 +1,4 @@ +[Test] +Exec=/bin/sh -c "cd @libexecdir@/installed-tests/gtk-4.0/gsk && @libexecdir@/installed-tests/gtk-4.0/gsk/test-render-nodes --tap" +Type=session +Output=TAP diff --git a/testsuite/gtk/meson.build b/testsuite/gtk/meson.build index 2afb14a3fc..a772a71613 100644 --- a/testsuite/gtk/meson.build +++ b/testsuite/gtk/meson.build @@ -77,7 +77,7 @@ foreach t : tests link_args : test_extra_ldflags, dependencies : libgtk_dep) - test('@0@ test'.format(test_name), test_exe, suite : 'gtk', env : test_env) + test(test_name, test_exe, suite : 'gtk', env : test_env) endforeach # FIXME: if objc autotestkeywords_CPPFLAGS += -DHAVE_OBJC=1 -x objective-c++ @@ -86,7 +86,7 @@ if add_languages('cpp') 'autotestkeywords.cc', c_args : test_cargs + ['-Idummy-headers'], dependencies : libgtk_dep) - test('autotestkeywords test', test_exe, suite : 'gtk', env : test_env) + test('c++ keywords', test_exe, suite : 'gtk', env : test_env) endif # FIXME: schemas from gtk+ dir? diff --git a/testsuite/tools/meson.build b/testsuite/tools/meson.build index 316b0b64c5..2515aa548e 100644 --- a/testsuite/tools/meson.build +++ b/testsuite/tools/meson.build @@ -9,7 +9,7 @@ if bash.found() input : 'test-@0@.in'.format(t), configuration : configuration_data()) - test('test-@0@'.format(t), bash, + test(t, bash, args : 'test-@0@'.format(t), workdir : meson.current_build_dir(), env : test_env,