tests/run-tests.py
changeset 9582 a25af3af941c
parent 9580 25858f9e65e8
child 9706 f8b4df4b033d
--- a/tests/run-tests.py	Fri Oct 09 16:27:05 2009 +0200
+++ b/tests/run-tests.py	Mon Oct 12 14:52:53 2009 -0500
@@ -90,6 +90,8 @@
     parser.add_option("-j", "--jobs", type="int",
         help="number of jobs to run in parallel"
              " (default: $%s or %d)" % defaults['jobs'])
+    parser.add_option("-k", "--keywords",
+        help="run tests matching keywords")
     parser.add_option("--keep-tmpdir", action="store_true",
         help="keep temporary directory after running tests"
              " (best used with --tmpdir)")
@@ -688,10 +690,21 @@
 
         skips = []
         fails = []
+
         for test in tests:
             if options.retest and not os.path.exists(test + ".err"):
                 skipped += 1
                 continue
+
+            if options.keywords:
+                t = open(test).read().lower() + test.lower()
+                for k in options.keywords.lower().split():
+                    if k in t:
+                        break
+                else:
+                    skipped +=1
+                    continue
+
             ret = runone(options, test, skips, fails)
             if ret is None:
                 skipped += 1