[Lldb-commits] [lldb] r129963 - /lldb/trunk/test/abbreviation_tests/TestAbbreviations.py

Johnny Chen johnny.chen at apple.com
Thu Apr 21 17:33:09 PDT 2011


Author: johnny
Date: Thu Apr 21 19:33:09 2011
New Revision: 129963

URL: http://llvm.org/viewvc/llvm-project?rev=129963&view=rev
Log:
Make the test case more robust by installing a teardown hook to kill the inferior
rather than calling "process kill" explicitly at the end of the test.

The test might not even reach the end because it could have failed prematurely.

Modified:
    lldb/trunk/test/abbreviation_tests/TestAbbreviations.py

Modified: lldb/trunk/test/abbreviation_tests/TestAbbreviations.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/abbreviation_tests/TestAbbreviations.py?rev=129963&r1=129962&r2=129963&view=diff
==============================================================================
--- lldb/trunk/test/abbreviation_tests/TestAbbreviations.py (original)
+++ lldb/trunk/test/abbreviation_tests/TestAbbreviations.py Thu Apr 21 19:33:09 2011
@@ -112,6 +112,12 @@
                     startstr = "1 breakpoints cleared:",
                     substrs = ["3: file ='main.cpp', line = 32, locations = 1"])
 
+        # Add a future to terminate the current process being debugged.
+        #
+        # The test framework relies on detecting either "run" or "process launch"
+        # command to automatically kill the inferior upon tear down.
+        # But we'll be using "pro la" command to launch the inferior.
+        self.addTearDownHook(lambda: self.runCmd("process kill"))
         self.expect("pro la",
                     patterns = [ "Process .* launched: "])
 
@@ -152,11 +158,6 @@
                                 '/usr/lib/libSystem.B.dylib',
                                 '/usr/lib/system/libmathCommon.A.dylib'])
 
-        # Terminate the current process being debugged.
-        # The test framework was relying on detecting either "run" or
-        # "process launch" command to automatically kill the inferior.
-        self.runCmd("process kill")
-
 
 if __name__ == '__main__':
     import atexit





More information about the lldb-commits mailing list