Skip to content

Commit bc15a12

Browse files
committed
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 on, why suddently there are fewer tests than before. Instead, run testwrap with an option that marks the test as skipped. That way, the total list and count of tests is constant whether the option is enabled or not. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/ad5ec96d-69ec-317b-a137-367ea5019b61@eisentraut.org
1 parent 2e8a0ed commit bc15a12

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

meson.build

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3252,8 +3252,9 @@ foreach test_dir : tests
32523252

32533253
testport += 1
32543254
elif kind == 'tap'
3255+
testwrap_tap = testwrap_base
32553256
if not tap_tests_enabled
3256-
continue
3257+
testwrap_tap += ['--skip', 'TAP tests not enabled']
32573258
endif
32583259

32593260
test_command = [
@@ -3293,7 +3294,7 @@ foreach test_dir : tests
32933294
test(test_dir['name'] / onetap_p,
32943295
python,
32953296
kwargs: test_kwargs,
3296-
args: testwrap_base + [
3297+
args: testwrap_tap + [
32973298
'--testgroup', test_dir['name'],
32983299
'--testname', onetap_p,
32993300
'--', test_command,

src/tools/testwrap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ parser.add_argument('--srcdir', help='source directory of test', type=str)
1212
parser.add_argument('--basedir', help='base directory of test', type=str)
1313
parser.add_argument('--testgroup', help='test group', type=str)
1414
parser.add_argument('--testname', help='test name', type=str)
15+
parser.add_argument('--skip', help='skip test (with reason)', type=str)
1516
parser.add_argument('test_command', nargs='*')
1617

1718
args = parser.parse_args()
@@ -23,6 +24,10 @@ print('# executing test in {} group {} test {}'.format(
2324
testdir, args.testgroup, args.testname))
2425
sys.stdout.flush()
2526

27+
if args.skip is not None:
28+
print('1..0 # Skipped: ' + args.skip)
29+
sys.exit(0)
30+
2631
if os.path.exists(testdir) and os.path.isdir(testdir):
2732
shutil.rmtree(testdir)
2833
os.makedirs(testdir)

0 commit comments

Comments
 (0)