Browse Source

Added --clean & --clean-all to the toolset

Nate Brady 9 years ago
parent
commit
fbf837bd2a
2 changed files with 9 additions and 4 deletions
  1. 7 2
      toolset/benchmark/benchmarker.py
  2. 2 2
      toolset/run-tests.py

+ 7 - 2
toolset/benchmark/benchmarker.py

@@ -964,10 +964,15 @@ 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)
+    if args['clean'] or args['clean_all']:
+        shutil.rmtree(os.path.join(self.fwroot, "results"))
     self.latest_results_directory = self.latest_results_directory()
   
+    # remove installs directories if --clean-all provided
+    if args['clean_all']:
+        os.system("sudo rm -rf " + os.path.join(self.fwroot, "installs"))
+        os.mkdir("installs")
+
     if hasattr(self, 'parse') and self.parse != None:
       self.timestamp = self.parse
     else:

+ 2 - 2
toolset/run-tests.py

@@ -146,7 +146,8 @@ 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)
+    parser.add_argument('--clean', action='store_true', help='Removes the results directory')
+    parser.add_argument('--clean-all', action='store_true', dest='clean_all', help='Removes the results and installs directories')
 
     # Test options
     parser.add_argument('--test', nargs='+', help='names of tests to run')
@@ -212,4 +213,3 @@ def main(argv=None):
 
 if __name__ == "__main__":
     sys.exit(main())
-kain