changeset 21328:9da0761a22a1

run-tests: check for test file existence in Test.run() We delay this a little bit. But it shouldn't really matter when the check is performed.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Apr 2014 21:00:24 -0700
parents 206814c9072a
children 8ead79ffbc40
files tests/run-tests.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sat Apr 19 20:53:45 2014 -0700
+++ b/tests/run-tests.py	Sat Apr 19 21:00:24 2014 -0700
@@ -582,6 +582,10 @@
             shutil.rmtree(self._threadtmp, True)
 
     def run(self, result):
+        if not os.path.exists(self._path):
+            result.skipped = True
+            return self.skip("Doesn't exist")
+
         # Remove any previous output files.
         if os.path.exists(self._errpath):
             os.remove(self._errpath)
@@ -1112,9 +1116,6 @@
     err = os.path.join(TESTDIR, test + ".err")
     lctest = test.lower()
 
-    if not os.path.exists(testpath):
-            return skip("doesn't exist")
-
     if not (options.whitelisted and test in options.whitelisted):
         if options.blacklist and test in options.blacklist:
             return skip("blacklisted")