From: José Fonseca Date: Sat, 29 Oct 2011 20:53:10 +0000 (+0100) Subject: Ensure trace are cleaned up. X-Git-Url: https://git.cworth.org/git?p=apitrace-tests;a=commitdiff_plain;h=5cde484f5bded377ca859164aa6919b0cbe3e7d8 Ensure trace are cleaned up. --- 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()