Browse Source

Warn if there is no default test

Hamilton Turner 10 years ago
parent
commit
58518c70f9
2 changed files with 15 additions and 3 deletions
  1. 5 0
      toolset/benchmark/framework_test.py
  2. 10 3
      toolset/benchmark/utils.py

+ 5 - 0
toolset/benchmark/framework_test.py

@@ -751,6 +751,11 @@ def parse_config(config, directory, benchmarker):
   # The config object can specify multiple tests
   #   Loop over them and parse each into a FrameworkTest
   for test in config['tests']:
+
+    names = [name for (name,keys) in test.iteritems()]
+    if "default" not in names:
+      logging.warn("Framework %s does not define a default test in benchmark_config", config['framework'])
+    
     for test_name, test_keys in test.iteritems():
       # Prefix all test names with framework except 'default' test
       if test_name == 'default': 

+ 10 - 3
toolset/benchmark/utils.py

@@ -71,13 +71,20 @@ def gather_tests(include = [], exclude=[], benchmarker=None):
     # Find all tests in the config file
     config_tests = framework_test.parse_config(config, 
       os.path.dirname(config_file_name), benchmarker)
-    
+        
     # Filter
     for test in config_tests:
-      if test.name in exclude:
+      if len(include) is 0 and len(exclude) is 0:
+        # No filters, we are running everything
+        tests.append(test)
+      elif test.name in exclude:
         continue
-      elif len(include) is 0 or test.name in include:
+      elif test.name in include:
         tests.append(test)
+      else: 
+        # An include list exists, but this test is 
+        # not listed there, so we ignore it
+        pass
 
   tests.sort(key=lambda x: x.name)
   return tests