Improve rerun-in-existing-dir functionality
authorClifford Wolf <clifford@clifford.at>
Sat, 9 Mar 2019 20:52:51 +0000 (12:52 -0800)
committerClifford Wolf <clifford@clifford.at>
Sat, 9 Mar 2019 20:52:51 +0000 (12:52 -0800)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
sbysrc/sby.py

index 20a200ff7227344bfa77f8117ebdb1d14d1de7f4..13d1cd1a193dbbb02da9d7c027dd4ab42fb56b52 100644 (file)
@@ -135,6 +135,10 @@ if len(args) > 0:
         if setupmode:
             print("ERROR: Can't use --setup with existing directory.", file=sys.stderr)
             sys.exit(1)
+        if opt_force:
+            for f in "PASS FAIL UNKNOWN ERROR TIMEOUT".split():
+                if os.path.exists(workdir + "/" + f):
+                    os.remove(workdir + "/" + f)
     elif not sbyfile.endswith(".sby"):
         print("ERROR: Sby file does not have .sby file extension.", file=sys.stderr)
         sys.exit(1)
@@ -318,7 +322,9 @@ def run_job(taskname):
     junit_ts_name = os.path.basename(sbyfile[:-4]) if sbyfile is not None else workdir if workdir is not None else "stdin"
     junit_tc_name = taskname if taskname is not None else "default"
 
-    if sbyfile is not None:
+    if reusedir:
+        junit_filename = os.path.basename(my_workdir)
+    elif sbyfile is not None:
         junit_filename = os.path.basename(sbyfile[:-4])
         if taskname is not None:
             junit_filename += "_" + taskname