Index: packages/Python/lldbsuite/test/lldbtest.py =================================================================== --- packages/Python/lldbsuite/test/lldbtest.py +++ packages/Python/lldbsuite/test/lldbtest.py @@ -705,11 +705,13 @@ def makeBuildDir(self): """Create the test-specific working directory, deleting any previous contents.""" - # See also dotest.py which sets up ${LLDB_BUILD}. + self.cleanBuildDir() + lldbutil.mkdir_p(self.getBuildDir()) + + def cleanBuildDir(self): bdir = self.getBuildDir() if os.path.isdir(bdir): shutil.rmtree(bdir) - lldbutil.mkdir_p(bdir) def getBuildArtifact(self, name="a.out"): """Return absolute path to an artifact in the test's build directory.""" @@ -1206,7 +1208,7 @@ log_files_for_this_test = glob.glob(self.log_basename + "*") if prefix != 'Success' or lldbtest_config.log_success: - # keep all log files, rename them to include prefix + # keep all test artifacts, rename log files to include prefix dst_log_basename = self.getLogBasenameForCurrentTest(prefix) for src in log_files_for_this_test: if os.path.isfile(src): @@ -1220,7 +1222,9 @@ os.rename(src, dst) else: - # success! (and we don't want log files) delete log files + # success! (and we don't want any artifacts): delete log files and + # nuke the build dir. + self.cleanBuildDir() for log_file in log_files_for_this_test: remove_file(log_file)