X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=blobdiff_plain;f=driver.py;h=7799b6587693f7d1db058c83a1fcaf5bd684e286;hp=660a1f9b0c70c58e863ec9ebdc2b1b3572c2cce6;hb=5cde484f5bded377ca859164aa6919b0cbe3e7d8;hpb=a6019a4b6c867eeb6294fe36bdb58044d1399ee3 diff --git a/driver.py b/driver.py index 660a1f9..7799b65 100755 --- a/driver.py +++ b/driver.py @@ -84,6 +84,12 @@ class TestCase: def trace(self): if self.trace_file is None: self.trace_file = os.path.abspath(os.path.join(self.results, self.name + '.trace')) + if os.path.exists(self.trace_file): + os.remove(self.trace_file) + else: + trace_dir = os.path.dirname(self.trace_file) + if not os.path.exists(trace_dir): + os.makedirs(trace_dir) env = os.environ.copy()