mbligh | 570e93e | 2006-11-26 05:15:56 +0000 | [diff] [blame] | 1 | #!/usr/bin/python |
| 2 | import sys, os, time |
| 3 | from subprocess import * |
| 4 | |
| 5 | # We want to set the output (stdout&stderr) of the autotest binary onto our |
| 6 | # stdout channel. We went to get the status stream of autotest back on our |
| 7 | # stderr channel - we set up fd 3 for this, and harness_simple.py can |
| 8 | # open it later. |
| 9 | |
| 10 | # Set up file descriptor 3 as a copy of our stderr. This is the status channel |
| 11 | os.dup2(2,3) |
| 12 | # Join our stderr in with our stdout |
| 13 | os.dup2(1,2) |
| 14 | |
| 15 | autodir = os.path.dirname(sys.argv[0]) |
| 16 | autotest = os.path.join(autodir, 'autotest') |
| 17 | cmd = ' '.join([autotest, '-H simple'] + sys.argv[1:]) |
| 18 | p = Popen(cmd, shell=True, stderr=STDOUT, close_fds=False) |
| 19 | os.waitpid(p.pid, 0) |