tests,ext: Add skip_cleanup implementation for TempdirFixture
Change-Id: Idc5ec9309a4ef3c0ad0c7e8b2df47294acc97ec4 Signed-off-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17451 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
@@ -98,6 +98,13 @@ class Fixture(object):
|
||||
def copy(self):
|
||||
return copy.deepcopy(self)
|
||||
|
||||
def skip_cleanup(self):
|
||||
'''
|
||||
If this method is called, then we should make sure that nothing is
|
||||
done when the teardown() function is called.
|
||||
'''
|
||||
pass
|
||||
|
||||
|
||||
def globalfixture(fixture):
|
||||
'''
|
||||
|
||||
@@ -55,6 +55,10 @@ class TempdirFixture(Fixture):
|
||||
if self.path is not None:
|
||||
shutil.rmtree(self.path)
|
||||
|
||||
def skip_cleanup(self):
|
||||
# Set path to none so it's not deleted
|
||||
self.path = None
|
||||
|
||||
|
||||
class SConsFixture(Fixture):
|
||||
'''
|
||||
|
||||
Reference in New Issue
Block a user