changeset 21331:bfe929a4b45b

run-tests: move keyword processing into Test.run()
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 19 Apr 2014 21:05:50 -0700
parents 3f79bacbf80b
children 60ce874f5b06
files tests/run-tests.py
diffstat 1 files changed, 10 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/tests/run-tests.py	Sat Apr 19 21:04:08 2014 -0700
+++ b/tests/run-tests.py	Sat Apr 19 21:05:50 2014 -0700
@@ -595,6 +595,16 @@
             if options.retest and not os.path.exists('%s.err' % self._test):
                 return self.ignore('not retesting')
 
+            if options.keywords:
+                f = open(self._test)
+                t = f.read().lower() + self._test.lower()
+                f.close()
+                for k in options.keywords.lower().split():
+                    if k in t:
+                        break
+                    else:
+                        return self.ignore("doesn't match keyword")
+
         # Remove any previous output files.
         if os.path.exists(self._errpath):
             os.remove(self._errpath)
@@ -1125,17 +1135,6 @@
     err = os.path.join(TESTDIR, test + ".err")
     lctest = test.lower()
 
-    if not (options.whitelisted and test in options.whitelisted):
-        if options.keywords:
-            fp = open(test)
-            t = fp.read().lower() + test.lower()
-            fp.close()
-            for k in options.keywords.lower().split():
-                if k in t:
-                    break
-                else:
-                    return ignore("doesn't match keyword")
-
     if not os.path.basename(lctest).startswith("test-"):
         return skip("not a test file")
     for ext, cls, out in testtypes: