Provided a mechanism for the test class to cleanup after itself once it's done.
This will remove the confusion experienced when previous test runs left some
files (both intermediate or by-product as a result of the test).
lldbtest.TestBase defines a classmethod tearDownClass(cls) which invokes the
platform-specific cleanup() function as defined by the plugin; after that, it
invokes a subclass-specific function classCleanup(cls) if defined; and, finally,
it restores the old working directory.
An example of classCleanup(cls) is in settings/TestSettings.py:
@classmethod
def classCleanup(cls):
system(["/bin/sh", "-c", "rm output.txt"])
where it deletes the by-product "output.txt" as a result of running a.out.
llvm-svn: 114058
diff --git a/lldb/test/persistent_variables/TestPersistentVariables.py b/lldb/test/persistent_variables/TestPersistentVariables.py
index 9f1ea77..b0b7170 100644
--- a/lldb/test/persistent_variables/TestPersistentVariables.py
+++ b/lldb/test/persistent_variables/TestPersistentVariables.py
@@ -13,7 +13,9 @@
def test_persistent_variables(self):
"""Test that lldb persistent variables works correctly."""
- self.runCmd("file ../array_types/a.out", CURRENT_EXECUTABLE_SET)
+ self.buildDefault()
+
+ self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
self.runCmd("breakpoint set --name main")