HomePhabricator

Fixed the failing test TestCommandScriptImmediateOutput on MacOSX. Turns out…
7da818fc982aUnpublished

Authored by fjricci on May 19 2016, 2:09 PM.

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

Fixed the failing test TestCommandScriptImmediateOutput on MacOSX. Turns out that there are few things to watch out for when writing pexpect tests:

1 - If you plan on looking for the "(lldb) " prompt as a regular expression, look for "\(lldb\) " so you don't just find "lldb".
2 - Make sure to not use colors (specify --no-use-colors as an option to lldb when launching it) as our editline will print:

"(lldb) <color junk>(lldb) "

where "<color junk>" is a work around that is used to allow us to colorize our prompts. The bad thing is this will make pexepct code like this not execute as you would expect:

prompt = "\(lldb\) "
self.child.sendline("breakpoint set ...", prompt)
self.child.sendline("breakpoint clear ...", prompt)

The problem is the first "sendline" will create two lldb prompts and will match both the first and second prompts and you output will get off. So be sure to disable colors if you need to.

Fixed a case where "TestCommandScriptImmediateOutput.py" would fail if you have spaces in your directory names. I modified custom_command.py to use shlex to parse arguments and I quoted the file path we sent down to the custom_command.write_file function.

Author: Greg Clayton <gclayton@apple.com>
Date: Wed Mar 30 00:02:13 2016 +0000

This is a cherry-pick of r264810

llvm-svn: 270138

Details

Committed
fjricciMay 19 2016, 2:09 PM
Parents
rG212def3a783e: Maintain register numbering across xml include features
Branches
Unknown
Tags
Unknown