From 04a101d475ab7b078f4f3ffa15fc8bebed3bc4a6 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Wed, 12 Oct 2011 17:50:41 +0000 Subject: [PATCH] Add cleanups for 'command script add' to TestCommandPython.py. llvm-svn: 141790 --- .../command_python/TestCommandPython.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lldb/test/functionalities/command_python/TestCommandPython.py b/lldb/test/functionalities/command_python/TestCommandPython.py index 243565161e9b..038749ce77ed 100644 --- a/lldb/test/functionalities/command_python/TestCommandPython.py +++ b/lldb/test/functionalities/command_python/TestCommandPython.py @@ -27,6 +27,16 @@ class CmdPythonTestCase(TestBase): self.runCmd("command source py_import") + # This is the function to remove the custom commands in order to have a + # clean slate for the next test case. + def cleanup(): + self.runCmd('command script delete welcome', check=False) + self.runCmd('command script delete targetname', check=False) + self.runCmd('command script delete longwait', check=False) + + # Execute the cleanup function during test case tear down. + self.addTearDownHook(cleanup) + # We don't want to display the stdout if not in TraceOn() mode. if not self.TraceOn(): self.HideStdout()