From b7611c4bcb5e728db5dba63f46aa71e4473dc23e Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Tue, 8 Dec 2020 05:54:15 +0100 Subject: build: Do not install .test files when test is skipped The skipping prevented the executable from being installed but not the .test file that referenced it. This caused installed tests to fail: Running test: gdk-pixbuf/pixbuf-pixdata.test Caught exception during testing: Failed to execute child process ?/nix/store/kqmj2776mw24qxyswfbqlmybpws4g4yn-gdk-pixbuf-2.42.0-installedTests/libexec/installed-tests/gdk-pixbuf/pixbuf-pixdata? (No such file or directory) --- tests/meson.build | 45 +++++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'tests') diff --git a/tests/meson.build b/tests/meson.build index c9cf25c6e..4368c6bae 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -174,6 +174,9 @@ foreach test_name, test_data: installed_tests test_sources += [ resources_c, resources_h ] endif skip_if_true = test_data.get('skip', false) + if skip_if_true + continue + endif custom_target(test_name + '.test', output: test_name + '.test', @@ -187,30 +190,28 @@ foreach test_name, test_data: installed_tests install_dir: installed_test_datadir, ) - if not skip_if_true - test_bin = executable(test_name, test_sources, - dependencies: test_deps, - include_directories: [ root_inc, gdk_pixbuf_inc, ], - c_args: common_cflags, - install: get_option('installed_tests'), - install_dir: installed_test_bindir, - ) - - # Two particularly slow tests - if test_suites.contains('slow') - timeout = 300 - else - timeout = 30 - endif + test_bin = executable(test_name, test_sources, + dependencies: test_deps, + include_directories: [ root_inc, gdk_pixbuf_inc, ], + c_args: common_cflags, + install: get_option('installed_tests'), + install_dir: installed_test_bindir, + ) - test(test_name, test_bin, - suite: test_suites, - args: test_args, - env: test_env, - timeout: timeout, - protocol: 'tap', - ) + # Two particularly slow tests + if test_suites.contains('slow') + timeout = 300 + else + timeout = 30 endif + + test(test_name, test_bin, + suite: test_suites, + args: test_args, + env: test_env, + timeout: timeout, + protocol: 'tap', + ) endforeach executable('pixbuf-read', -- cgit v1.2.1 From 9d4d7e53539d1e9222fb9d4466700af37147b8e1 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Sat, 12 Dec 2020 16:12:59 +0000 Subject: tests: Don't check whether bmp and gif loaders are enabled This is conceptually similar to commit 2fd7d21f "tests: Fix GIF tests being permanently disabled". One way or another, gdk-pixbuf always supports these two formats: on Windows with the native gdiplus loader enabled, it covers these two formats; otherwise, format-specific loaders are used. This means we will run the GIF tests, as intended. Fixes: 7f0b214a "tests: Conditionally build and run tests" Signed-off-by: Simon McVittie --- tests/meson.build | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/meson.build b/tests/meson.build index 4368c6bae..ab7ff1eee 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -1,6 +1,6 @@ # Resources contain PNG and BMP files, so we need these two loaders # enabled in order to build them -if enabled_loaders.contains('png') and enabled_loaders.contains('bmp') +if enabled_loaders.contains('png') # Resources; we cannot use gnome.compile_resources() here, because we need to # override the environment in order to use the utilities we just built instead # of the system ones @@ -65,7 +65,6 @@ installed_tests = { 'pixbuf-construction': { 'suites': ['conform'], }, 'animation': { 'suites': ['format'], - 'skip': not enabled_loaders.contains('gif'), }, 'cve-2015-4491': { 'suites': ['security'], @@ -107,11 +106,9 @@ installed_tests = { 'pixbuf-scale-two-step': { 'suites': ['ops'], }, 'pixbuf-short-gif-write': { 'suites': ['format'], - 'skip': not enabled_loaders.contains('gif'), }, 'pixbuf-gif-circular-table': { 'suites': ['format'], - 'skip': not enabled_loaders.contains('gif'), }, 'pixbuf-save': { 'suites': ['io'] }, 'pixbuf-readonly-to-mutable': { 'suites': ['conform'], }, -- cgit v1.2.1