rdar://problem/10492827

SBProcess.GetSTDERR() not getting stderr of the launched process

Since we are launch the inferior with:

    process = target.LaunchSimple(None, None, os.getcwd())

i.e., without specifying stdin/out/err.  A pseudo terminal is used for
handling the process I/O, and we are satisfied once the expected output
appears in process.GetSTDOUT().

llvm-svn: 147983
This commit is contained in:
Johnny Chen 2012-01-12 00:29:46 +00:00
parent 4f8cb1e83a
commit 5886fb5bd3
2 changed files with 5 additions and 3 deletions

View File

@ -49,10 +49,10 @@ class ProcessIOTestCase(TestBase):
error = process.GetSTDERR(500) error = process.GetSTDERR(500)
if self.TraceOn(): if self.TraceOn():
print "output->|%s|" % output print "output->|%s|" % output
print "error->|%s|" % error # Since we launched the process without specifying stdin/out/err,
# We are satisfied once "input line=>1" appears in stderr. # a pseudo terminal is used for stdout/err, and we are satisfied
# once "input line=>1" appears in stdout.
# See also main.c. # See also main.c.
#if "input line=>1" in error:
if "input line=>1" in output: if "input line=>1" in output:
return return
time.sleep(5) time.sleep(5)

View File

@ -6,6 +6,8 @@ int main(int argc, char const *argv[]) {
int count = 1; int count = 1;
while (fgets(line, sizeof(line), stdin)) { // Reading from stdin... while (fgets(line, sizeof(line), stdin)) { // Reading from stdin...
fprintf(stderr, "input line=>%d\n", count++); fprintf(stderr, "input line=>%d\n", count++);
if (count > 3)
break;
} }
printf("Exiting now\n"); printf("Exiting now\n");