Skip to content

Commit

Permalink
Clean up emitted files as the test harness runs (#4086)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephanTLavavej committed Oct 14, 2023
1 parent 05b3152 commit a9123e8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/utils/stl/test/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ class SharedState:
('Build', self.getBuildSteps(test, litConfig, shared), True),
('Intellisense response file', self.getIsenseRspFileSteps(test, litConfig, shared), False),
('Test setup', self.getTestSetupSteps(test, litConfig, shared), False),
('Test', self.getTestSteps(test, litConfig, shared), False)]
('Test', self.getTestSteps(test, litConfig, shared), False),
('Clean', self.getCleanSteps(test, litConfig, shared), True)]

def getBuildSetupSteps(self, test, litConfig, shared):
shutil.rmtree(shared.execDir, ignore_errors=True)
Expand Down Expand Up @@ -204,6 +205,11 @@ def getTestSteps(self, test, litConfig, shared):
shouldFail = TestType.FAIL in test.testType
yield TestStep([shared.execFile], shared.execDir, shared.env, shouldFail)

def getCleanSteps(self, test, litConfig, shared):
shutil.rmtree(shared.execDir, ignore_errors=True)

yield from []

def execute(self, test, litConfig):
try:
result = test.configureTest(litConfig)
Expand Down

0 comments on commit a9123e8

Please sign in to comment.