Browse Source

ony tests from selected type will be run

Patrick Falls 12 years ago
parent
commit
f0705b692d
2 changed files with 24 additions and 0 deletions
  1. 4 0
      benchmarker.py
  2. 20 0
      framework_test.py

+ 4 - 0
benchmarker.py

@@ -305,6 +305,10 @@ class Benchmarker:
       if self.exclude != None and test.name in self.exclude:
         continue
       
+      # If the test does not contain an implementation of the current test-type, skip it
+      if not test.containsType(self.type):
+        continue
+      
       print textwrap.dedent("""
       =====================================================
         Beginning {name}

+ 20 - 0
framework_test.py

@@ -155,6 +155,26 @@ class FrameworkTest:
   # End verify_urls
   ############################################################
 
+  ############################################################
+  # contains_type(type)
+  # true if this test contains an implementation of the given 
+  # test type (json, db, etc.)
+  ############################################################
+  def contains_type(self, type):
+    if type == 'json' and self.json_url not None:
+      return True
+    if type == 'db' and self.db_url not None:
+      return True
+    if type == 'query' and self.query_url not None:
+      return True
+    if type == 'fortune' and self.fortune_url not None:
+      return True
+      
+    return False
+  ############################################################
+  # End stop
+  ############################################################
+
   ############################################################
   # benchmark
   # Runs the benchmark for each type of test that it implements