mtest: ignore invalid input

TAP version 14 introduced subtests, that are supposedly backward compatible
because "TAP13 specifies that non-TAP output should be ignored".  Meson
reported TAP syntax errors based on behavior of "prove" at the time,
but it seems that now "prove" has become a lot more lenient; it even
accepts the following completely bogus input just fine:

---
ok 1
    ok 2
x
1..1
---

So do the same and make Meson's parser accept invalid TAP input silently.

Fixes: #10032
pull/10303/head
Paolo Bonzini 3 years ago committed by Jussi Pakkanen
parent 4acab57d47
commit a7e458effa
  1. 5
      mesonbuild/mtest.py
  2. 1
      unittests/taptests.py

@ -426,11 +426,6 @@ class TAPParser:
else:
yield self.Version(version=self.version)
return
if not line:
return
yield self.Error(f'unexpected input at line {self.lineno}')
else:
# end of file
if self.state == self._YAML:

@ -255,7 +255,6 @@ class TAPParserTests(unittest.TestCase):
def test_unexpected(self):
events = self.parse_tap('1..1\ninvalid\nok 1')
self.assert_plan(events, num_tests=1, late=False)
self.assert_error(events)
self.assert_test(events, number=1, name='', result=TestResult.OK)
self.assert_last(events)

Loading…
Cancel
Save