From 19e78e4c5a16337c0ac4e661beb4729505736016 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 30 Oct 2023 05:32:45 -0400 Subject: [PATCH] Explicitly skip TAP tests under Meson if disabled If the tap_tests option is disabled under Meson, the TAP tests are currently not registered at all. But this makes it harder to see what is going one, why suddently there are fewer tests than before. Instead, register the tests anyway but with a dummy command that marks them as skipped. That way, the total list and count of tests is constant whether the option is enabled or not. --- meson.build | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/meson.build b/meson.build index 2d516c8f372..1795dd8159e 100644 --- a/meson.build +++ b/meson.build @@ -3248,10 +3248,6 @@ foreach test_dir : tests testport += 1 elif kind == 'tap' - if not tap_tests_enabled - continue - endif - test_command = [ perl.path(), '-I', meson.source_root() / 'src/test/perl', @@ -3286,16 +3282,23 @@ foreach test_dir : tests onetap_p = fs.stem(onetap_p) endif - test(test_dir['name'] / onetap_p, - python, - kwargs: test_kwargs, - args: testwrap_base + [ - '--testgroup', test_dir['name'], - '--testname', onetap_p, - '--', test_command, - test_dir['sd'] / onetap, - ], - ) + if tap_tests_enabled + test(test_dir['name'] / onetap_p, + python, + kwargs: test_kwargs, + args: testwrap_base + [ + '--testgroup', test_dir['name'], + '--testname', onetap_p, + '--', test_command, + test_dir['sd'] / onetap, + ], + ) + else + test(test_dir['name'] / onetap_p, + perl, + args: ['-e', 'print "1..0 # Skipped: TAP tests not enabled"'], + kwargs: test_kwargs) + endif endforeach install_suites += test_group else -- 2.42.0