diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2010-04-11 20:56:02 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2010-04-11 20:57:33 +0200 |
commit | 5d0694f9941e22f92c9c641b8fb3a7ce376ee5cd (patch) | |
tree | 0a5425c58cbdc0177472e7332c2d32d94499e876 /lib | |
parent | 3a34b5f35ec0a666ff8f731577bd2fdfa67e9dcb (diff) | |
download | samba-5d0694f9941e22f92c9c641b8fb3a7ce376ee5cd.tar.gz samba-5d0694f9941e22f92c9c641b8fb3a7ce376ee5cd.tar.xz samba-5d0694f9941e22f92c9c641b8fb3a7ce376ee5cd.zip |
subunit: Cope with lowercase test results in tap2subunit.
Also submitted upstream.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/subunit/python/subunit/__init__.py | 6 | ||||
-rw-r--r-- | lib/subunit/python/subunit/tests/test_tap2subunit.py | 15 |
2 files changed, 16 insertions, 5 deletions
diff --git a/lib/subunit/python/subunit/__init__.py b/lib/subunit/python/subunit/__init__.py index 6b65ae42dc..4b25ca3a39 100644 --- a/lib/subunit/python/subunit/__init__.py +++ b/lib/subunit/python/subunit/__init__.py @@ -913,7 +913,7 @@ def TAP2SubUnit(tap, subunit): 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() @@ -927,9 +927,9 @@ def TAP2SubUnit(tap, subunit): 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) diff --git a/lib/subunit/python/subunit/tests/test_tap2subunit.py b/lib/subunit/python/subunit/tests/test_tap2subunit.py index febfe9d441..c4ca4cdb3a 100644 --- a/lib/subunit/python/subunit/tests/test_tap2subunit.py +++ b/lib/subunit/python/subunit/tests/test_tap2subunit.py @@ -18,9 +18,7 @@ import unittest from StringIO import StringIO -import os import subunit -import sys class TestTAP2SubUnit(unittest.TestCase): @@ -125,6 +123,19 @@ 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 |