Mercurial > public > mercurial-scm > hg-stable
diff tests/test-run-tests.t @ 38234:507bdc40bb17
run-tests: add support for running specific test cases
Differential Revision: https://phab.mercurial-scm.org/D3555
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 26 Apr 2018 23:57:20 +0200 |
parents | 89793289c891 |
children | b865bba56db1 |
line wrap: on
line diff
--- a/tests/test-run-tests.t Sun Jun 03 17:02:38 2018 +0530 +++ b/tests/test-run-tests.t Thu Apr 26 23:57:20 2018 +0200 @@ -1571,7 +1571,77 @@ .. # Ran 2 tests, 0 skipped, 0 failed. +Support running a specific test case + + $ rt "test-cases-abc.t (case B)" + + --- $TESTTMP/anothertests/cases/test-cases-abc.t + +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err + @@ -7,7 +7,7 @@ + $ V=C + #endif + $ echo $V | sed 's/A/C/' + - C + + B + #if C + $ [ $V = C ] + #endif + + ERROR: test-cases-abc.t (case B) output changed + ! + Failed test-cases-abc.t (case 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)" + + --- $TESTTMP/anothertests/cases/test-cases-abc.t + +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err + @@ -7,7 +7,7 @@ + $ V=C + #endif + $ echo $V | sed 's/A/C/' + - C + + B + #if C + $ [ $V = C ] + #endif + + ERROR: test-cases-abc.t (case B) output changed + !. + Failed test-cases-abc.t (case 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)" + + --- $TESTTMP/anothertests/cases/test-cases-abc.t + +++ $TESTTMP/anothertests/cases/test-cases-abc.t.B.err + @@ -7,7 +7,7 @@ + $ V=C + #endif + $ echo $V | sed 's/A/C/' + - C + + B + #if C + $ [ $V = C ] + #endif + + ERROR: test-cases-abc.t (case B) output changed + ! + Failed test-cases-abc.t (case B): output changed + # Ran 1 tests, 0 skipped, 1 failed. + python hash seed: * (glob) + [1] + Test automatic pattern replacement +================================== $ cat << EOF >> common-pattern.py > substitutions = [