changeset 32740:0cd641bfbf57

run-tests: make --restart work with output dir
author Siddharth Agarwal <sid0@fb.com>
date Wed, 07 Jun 2017 21:17:24 -0700
parents 74680ed89a29
children c2cb0de25120
files tests/run-tests.py tests/test-run-tests.t
diffstat 2 files changed, 27 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Wed Jun 07 21:17:06 2017 -0700
+++ b/tests/run-tests.py	Wed Jun 07 21:17:24 2017 -0700
@@ -2397,10 +2397,12 @@
                 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)
--- a/tests/test-run-tests.t	Wed Jun 07 21:17:06 2017 -0700
+++ b/tests/test-run-tests.t	Wed Jun 07 21:17:24 2017 -0700
@@ -1183,3 +1183,28 @@
   # 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]