Add a teardown function to TestAbbreviations so it doesn't error out when running...
authorFilipe Cabecinhas <me@filcab.net>
Thu, 25 Oct 2012 23:52:28 +0000 (23:52 +0000)
committerFilipe Cabecinhas <me@filcab.net>
Thu, 25 Oct 2012 23:52:28 +0000 (23:52 +0000)
llvm-svn: 166740

lldb/test/functionalities/abbreviation/TestAbbreviations.py

index b6c124a..2f63020 100644 (file)
@@ -9,7 +9,7 @@ from lldbtest import *
 import lldbutil
 
 class AbbreviationsTestCase(TestBase):
-    
+
     mydir = os.path.join("functionalities", "abbreviation")
 
     def test_nonrunning_command_abbreviations (self):
@@ -35,6 +35,11 @@ class AbbreviationsTestCase(TestBase):
         self.expect("h",
                     startstr = "The following is a list of built-in, permanent debugger commands:")
 
+        # Execute cleanup function during test tear down
+        def cleanup():
+            self.runCmd("command alias t thread select")
+        self.addTearDownHook(cleanup)
+
         # Several matching commands: list them and error out.
         self.runCmd("command unalias t")
         self.expect("t",
@@ -136,7 +141,7 @@ class AbbreviationsTestCase(TestBase):
                                  "thread #1:",
                                  "a.out",
                                  "sum\(a=1238, b=78392\)",
-                                 "at main.cpp\:25", 
+                                 "at main.cpp\:25",
                                  "stop reason = breakpoint 2.1" ])
 
         # ARCH, if not specified, defaults to x86_64.
@@ -147,7 +152,7 @@ class AbbreviationsTestCase(TestBase):
                                    ' mov',
                                    ' addl ',
                                    'ret'],
-                        patterns = ['(leave|popq|popl)'])                               
+                        patterns = ['(leave|popq|popl)'])
 
         self.expect("i d l main.cpp",
                     patterns = ["Line table for .*main.cpp in `a.out"])