mtest: fix skipping with various prefixes

According to the specification:
https://testanything.org/tap-specification.html#skipping-tests

  The harness should report the text after # SKIP\S*\s+ as a reason for
  skipping.

(it's not exactly like the TODO directive, the phrasing/presentation of
the spec could be improved).
pull/7568/head
Marc-André Lureau 4 years ago committed by Jussi Pakkanen
parent a65ef70b7d
commit 8e98819b06
  1. 2
      mesonbuild/mtest.py
  2. 1
      test cases/common/213 tap tests/meson.build

@ -206,7 +206,7 @@ class TAPParser:
explanation = explanation.strip() if explanation else None
if directive is not None:
directive = directive.upper()
if directive == 'SKIP':
if directive.startswith('SKIP'):
if ok:
yield self.Test(num, name, TestResult.SKIP, explanation)
return

@ -9,5 +9,6 @@ test('xpass', tester, args : ['ok # todo'], should_fail: true, protocol: 'tap')
test('skip', tester, args : ['ok # skip'], protocol: 'tap')
test('partially skipped', tester, args : ['ok 1\nok 2 # skip'], protocol: 'tap')
test('partially skipped (real-world example)', cat, args : [files('issue7515.txt')], protocol: 'tap')
test('skip comment', tester, args : ['ok # Skipped: with a comment'], protocol: 'tap')
test('skip failure', tester, args : ['not ok # skip'], should_fail: true, protocol: 'tap')
test('no tests', tester, args : ['1..0 # skip'], protocol: 'tap')

Loading…
Cancel
Save