tests,ext: Add skip_cleanup implementation for TempdirFixture
authorJason Lowe-Power <jason@lowepower.com>
Wed, 13 Mar 2019 17:32:07 +0000 (10:32 -0700)
committerJason Lowe-Power <jason@lowepower.com>
Thu, 21 Mar 2019 15:57:10 +0000 (15:57 +0000)
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>
ext/testlib/fixture.py
tests/gem5/fixture.py

index ffff54cd881c7e38d9c22118d938cac599950595..be8924474f00683e89e3c5c8df0c747f6334a862 100644 (file)
@@ -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):
     '''
index df834ef75ba0cdaa789875264be3c4322bcf665f..9d9319c1e7d6dc75a5cc594da267f8d96a2ff689 100644 (file)
@@ -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):
     '''