subunit.write("]\n")
continue
# not a plan line, or have seen one before
- match = re.match("(ok|not ok)(?:\s+(\d+)?)?(?:\s+([^#]*[^#\s]+)\s*)?(?:\s+#\s+(TODO|SKIP)(?:\s+(.*))?)?\n", line)
+ match = re.match("(ok|not ok)(?:\s+(\d+)?)?(?:\s+([^#]*[^#\s]+)\s*)?(?:\s+#\s+(TODO|SKIP|skip|todo)(?:\s+(.*))?)?\n", line)
if match:
# new test, emit current one.
_emit_test()
else:
description = ' ' + description
if directive is not None:
- if directive == 'TODO':
+ if directive.upper() == 'TODO':
result = 'xfail'
- elif directive == 'SKIP':
+ elif directive.upper() == 'SKIP':
result = 'skip'
if directive_comment is not None:
log.append(directive_comment)
import unittest
from StringIO import StringIO
-import os
import subunit
-import sys
class TestTAP2SubUnit(unittest.TestCase):
],
self.subunit.getvalue().splitlines())
+ def test_ok_skip_number_comment_lowercase(self):
+ self.tap.write("ok 1 # skip no samba environment available, skipping compilation\n")
+ self.tap.seek(0)
+ result = subunit.TAP2SubUnit(self.tap, self.subunit)
+ self.assertEqual(0, result)
+ self.assertEqual([
+ "test test 1",
+ "skip test 1 [",
+ "no samba environment available, skipping compilation",
+ "]"
+ ],
+ self.subunit.getvalue().splitlines())
+
def test_ok_number_description_SKIP_skip_comment(self):
# A file
# ok 1 foo # SKIP Not done yet