Use self.TraceOn() API.

llvm-svn: 129890
This commit is contained in:
Johnny Chen 2011-04-20 22:59:01 +00:00
parent 0e5e5a798e
commit 951e3b5618
1 changed files with 10 additions and 0 deletions

View File

@ -29,6 +29,16 @@ class AliasTestCase(TestBase):
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!" ])