##// END OF EJS Templates
run-tests: follow-up on the test-case format...
Boris Feld -
r38263:f2e3196a @32 default
parent child Browse files
Show More
@@ -120,7 +120,7 b' if pygmentspresent:'
120 }
120 }
121
121
122 class TestRunnerLexer(lexer.RegexLexer):
122 class TestRunnerLexer(lexer.RegexLexer):
123 testpattern = r'[\w-]+\.(t|py)(#[\w-]+)?'
123 testpattern = r'[\w-]+\.(t|py)(#[^\s]+)?'
124 tokens = {
124 tokens = {
125 'root': [
125 'root': [
126 (r'^Skipped', token.Generic.Skipped, 'skipped'),
126 (r'^Skipped', token.Generic.Skipped, 'skipped'),
@@ -2646,7 +2646,7 b' class TestRunner(object):'
2646 expanded_args.append(arg)
2646 expanded_args.append(arg)
2647 args = expanded_args
2647 args = expanded_args
2648
2648
2649 testcasepattern = re.compile(r'([\w-]+\.t|py)(#([\w-])+)')
2649 testcasepattern = re.compile(r'([\w-]+\.t|py)(#([^\s]+))')
2650 tests = []
2650 tests = []
2651 for t in args:
2651 for t in args:
2652 case = None
2652 case = None
@@ -1617,7 +1617,7 b' Support running multiple test cases in t'
1617 python hash seed: * (glob)
1617 python hash seed: * (glob)
1618 [1]
1618 [1]
1619
1619
1620 Support running invalid test cases
1620 Support ignoring invalid test cases
1621
1621
1622 $ rt test-cases-abc.t#B test-cases-abc.t#D
1622 $ rt test-cases-abc.t#B test-cases-abc.t#D
1623
1623
@@ -1640,6 +1640,81 b' Support running invalid test cases'
1640 python hash seed: * (glob)
1640 python hash seed: * (glob)
1641 [1]
1641 [1]
1642
1642
1643 Support running complex test cases names
1644
1645 $ cat > test-cases-advanced-cases.t <<'EOF'
1646 > #testcases simple case-with-dashes casewith!@#$%^&*()chars
1647 > $ echo $TESTCASE
1648 > simple
1649 > EOF
1650
1651 $ cat test-cases-advanced-cases.t
1652 #testcases simple case-with-dashes casewith!@#$%^&*()chars
1653 $ echo $TESTCASE
1654 simple
1655
1656 $ rt test-cases-advanced-cases.t
1657
1658 --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
1659 +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err
1660 @@ -1,3 +1,3 @@
1661 #testcases simple case-with-dashes casewith!@#$%^&*()chars
1662 $ echo $TESTCASE
1663 - simple
1664 + case-with-dashes
1665
1666 ERROR: test-cases-advanced-cases.t#case-with-dashes output changed
1667 !
1668 --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
1669 +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith!@#$%^&*()chars.err
1670 @@ -1,3 +1,3 @@
1671 #testcases simple case-with-dashes casewith!@#$%^&*()chars
1672 $ echo $TESTCASE
1673 - simple
1674 + casewith!@#$%^&*()chars
1675
1676 ERROR: test-cases-advanced-cases.t#casewith!@#$%^&*()chars output changed
1677 !.
1678 Failed test-cases-advanced-cases.t#case-with-dashes: output changed
1679 Failed test-cases-advanced-cases.t#casewith!@#$%^&*()chars: output changed
1680 # Ran 3 tests, 0 skipped, 2 failed.
1681 python hash seed: * (glob)
1682 [1]
1683
1684 $ rt "test-cases-advanced-cases.t#case-with-dashes"
1685
1686 --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
1687 +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.case-with-dashes.err
1688 @@ -1,3 +1,3 @@
1689 #testcases simple case-with-dashes casewith!@#$%^&*()chars
1690 $ echo $TESTCASE
1691 - simple
1692 + case-with-dashes
1693
1694 ERROR: test-cases-advanced-cases.t#case-with-dashes output changed
1695 !
1696 Failed test-cases-advanced-cases.t#case-with-dashes: output changed
1697 # Ran 1 tests, 0 skipped, 1 failed.
1698 python hash seed: * (glob)
1699 [1]
1700
1701 $ rt "test-cases-advanced-cases.t#casewith!@#$%^&*()chars"
1702
1703 --- $TESTTMP/anothertests/cases/test-cases-advanced-cases.t
1704 +++ $TESTTMP/anothertests/cases/test-cases-advanced-cases.t.casewith!@#$%^&*()chars.err
1705 @@ -1,3 +1,3 @@
1706 #testcases simple case-with-dashes casewith!@#$%^&*()chars
1707 $ echo $TESTCASE
1708 - simple
1709 + casewith!@#$%^&*()chars
1710
1711 ERROR: test-cases-advanced-cases.t#casewith!@#$%^&*()chars output changed
1712 !
1713 Failed test-cases-advanced-cases.t#casewith!@#$%^&*()chars: output changed
1714 # Ran 1 tests, 0 skipped, 1 failed.
1715 python hash seed: * (glob)
1716 [1]
1717
1643 Test automatic pattern replacement
1718 Test automatic pattern replacement
1644 ==================================
1719 ==================================
1645
1720
General Comments 0
You need to be logged in to leave comments. Login now