Browse Source

Added the --clean results option to the toolset

Nate Brady 9 years ago
parent
commit
34b79546ea
2 changed files with 5 additions and 0 deletions
  1. 3 0
      toolset/benchmark/benchmarker.py
  2. 2 0
      toolset/run-tests.py

+ 3 - 0
toolset/benchmark/benchmarker.py

@@ -9,6 +9,7 @@ from utils import gather_frameworks
 from utils import verify_database_connections
 
 import os
+import shutil
 import stat
 import json
 import subprocess
@@ -963,6 +964,8 @@ class Benchmarker:
 
     # setup results and latest_results directories 
     self.result_directory = os.path.join("results", self.name)
+    if args['clean'] == 'results':
+        shutil.rmtree(self.result_directory)
     self.latest_results_directory = self.latest_results_directory()
   
     if hasattr(self, 'parse') and self.parse != None:

+ 2 - 0
toolset/run-tests.py

@@ -146,6 +146,7 @@ def main(argv=None):
         help='''Affects : With unified, all server software is installed into a single directory. 
         With pertest each test gets its own installs directory, but installation takes longer''')
     parser.add_argument('--install-only', action='store_true', default=False, help='Do not run benchmark or verification, just install and exit')
+    parser.add_argument('--clean', choices=['results'], help='Removes the results directory', default=None)
 
     # Test options
     parser.add_argument('--test', nargs='+', help='names of tests to run')
@@ -211,3 +212,4 @@ def main(argv=None):
 
 if __name__ == "__main__":
     sys.exit(main())
+kain