diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -120,7 +120,7 @@ if pygmentspresent: } class TestRunnerLexer(lexer.RegexLexer): - testpattern = r'[\w-]+\.(t|py)( \(case [\w-]+\))?' + testpattern = r'[\w-]+\.(t|py)(#[\w-]+)?' tokens = { 'root': [ (r'^Skipped', token.Generic.Skipped, 'skipped'), @@ -1247,7 +1247,7 @@ class TTest(Test): self._allcases = parsettestcases(path) super(TTest, self).__init__(path, *args, **kwds) if case: - self.name = '%s (case %s)' % (self.name, _strpath(case)) + self.name = '%s#%s' % (self.name, _strpath(case)) self.errpath = b'%s.%s.err' % (self.errpath[:-4], case) self._tmpname += b'-%s' % case self._have = {} @@ -2646,7 +2646,7 @@ class TestRunner(object): expanded_args.append(arg) args = expanded_args - testcasepattern = re.compile(r'([\w-]+\.t|py)( \(case ([\w-])+\))') + testcasepattern = re.compile(r'([\w-]+\.t|py)(#([\w-])+)') tests = [] for t in args: case = None diff --git a/tests/test-run-tests.t b/tests/test-run-tests.t --- a/tests/test-run-tests.t +++ b/tests/test-run-tests.t @@ -1496,9 +1496,9 @@ Test cases in .t files $ [ $V = C ] #endif - ERROR: test-cases-abc.t (case B) output changed + ERROR: test-cases-abc.t#B output changed !. - Failed test-cases-abc.t (case B): output changed + Failed test-cases-abc.t#B: output changed # Ran 3 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] @@ -1519,9 +1519,9 @@ Test cases in .t files $ [ $V = C ] #endif - ERROR: test-cases-abc.t (case B) output changed + ERROR: test-cases-abc.t#B output changed !. - Failed test-cases-abc.t (case B): output changed + Failed test-cases-abc.t#B: output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] @@ -1544,9 +1544,9 @@ Test cases in .t files $ [ $V = C ] #endif - ERROR: test-cases-abc.t (case B) output changed + ERROR: test-cases-abc.t#B output changed !. - Failed test-cases-abc.t (case B): output changed + Failed test-cases-abc.t#B: output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] @@ -1573,7 +1573,7 @@ Test TESTCASE variable Support running a specific test case - $ rt "test-cases-abc.t (case B)" + $ rt "test-cases-abc.t#B" --- $TESTTMP/anothertests/cases/test-cases-abc.t +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err @@ -1587,16 +1587,16 @@ Support running a specific test case $ [ $V = C ] #endif - ERROR: test-cases-abc.t (case B) output changed + ERROR: test-cases-abc.t#B output changed ! - Failed test-cases-abc.t (case B): output changed + Failed test-cases-abc.t#B: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] Support running multiple test cases in the same file - $ rt "test-cases-abc.t (case B)" "test-cases-abc.t (case C)" + $ rt test-cases-abc.t#B test-cases-abc.t#C --- $TESTTMP/anothertests/cases/test-cases-abc.t +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err @@ -1610,16 +1610,16 @@ Support running multiple test cases in t $ [ $V = C ] #endif - ERROR: test-cases-abc.t (case B) output changed + ERROR: test-cases-abc.t#B output changed !. - Failed test-cases-abc.t (case B): output changed + Failed test-cases-abc.t#B: output changed # Ran 2 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1] Support running invalid test cases - $ rt "test-cases-abc.t (case B)" "test-cases-abc.t (case D)" + $ rt test-cases-abc.t#B test-cases-abc.t#D --- $TESTTMP/anothertests/cases/test-cases-abc.t +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err @@ -1633,9 +1633,9 @@ Support running invalid test cases $ [ $V = C ] #endif - ERROR: test-cases-abc.t (case B) output changed + ERROR: test-cases-abc.t#B output changed ! - Failed test-cases-abc.t (case B): output changed + Failed test-cases-abc.t#B: output changed # Ran 1 tests, 0 skipped, 1 failed. python hash seed: * (glob) [1]