[Lldb-commits] [lldb] r129890 - /lldb/trunk/test/alias_tests/TestAliases.py

Johnny Chen johnny.chen at apple.com
Wed Apr 20 15:59:01 PDT 2011


Author: johnny
Date: Wed Apr 20 17:59:01 2011
New Revision: 129890

URL: http://llvm.org/viewvc/llvm-project?rev=129890&view=rev
Log:
Use self.TraceOn() API.

Modified:
    lldb/trunk/test/alias_tests/TestAliases.py

Modified: lldb/trunk/test/alias_tests/TestAliases.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/alias_tests/TestAliases.py?rev=129890&r1=129889&r2=129890&view=diff
==============================================================================
--- lldb/trunk/test/alias_tests/TestAliases.py (original)
+++ lldb/trunk/test/alias_tests/TestAliases.py Wed Apr 20 17:59:01 2011
@@ -29,6 +29,16 @@
         self.runCmd (r'''command alias hello expr (int) printf ("\n\nHello, anybody!\n\n")''')
 
         self.runCmd ("command alias python script")
+
+        # We don't want to display the stdout if not in TraceOn() mode.
+        if not self.TraceOn():
+            old_stdout = sys.stdout
+            session = StringIO.StringIO()
+            sys.stdout = session
+            def restore_stdout():
+                sys.stdout = old_stdout
+            self.addTearDownHook(restore_stdout)
+
         self.runCmd (r'''python print "\n\n\nWhoopee!\n\n\n"''')
 #        self.expect (r'''python print "\n\n\nWhoopee!\n\n\n"''',
 #                     substrs = [ "Whoopee!" ])





More information about the lldb-commits mailing list