diff --git a/tests/run-tests.py b/tests/run-tests.py --- a/tests/run-tests.py +++ b/tests/run-tests.py @@ -2397,10 +2397,12 @@ class TestRunner(object): orig = list(testdescs) while testdescs: desc = testdescs[0] + # desc['path'] is a relative path if 'case' in desc: errpath = b'%s.%s.err' % (desc['path'], desc['case']) else: errpath = b'%s.err' % desc['path'] + errpath = os.path.join(self._outputdir, errpath) if os.path.exists(errpath): break testdescs.pop(0) 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 @@ -1183,3 +1183,28 @@ Test cases in .t files # Ran 2 tests, 0 skipped, 0 warned, 1 failed. python hash seed: * (glob) [1] + +--restart works with outputdir + + $ mkdir output + $ mv test-cases-abc.t.B.err output + $ rt --restart --outputdir output + + --- $TESTTMP/anothertests/cases/test-cases-abc.t + +++ $TESTTMP/anothertests/cases/output/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, 0 warned, 1 failed. + python hash seed: * (glob) + [1]