Merge lp:~pwlars/lava-test/betteroutput into lp:lava-test/0.0
Proposed by
Paul Larson
Status: | Merged |
---|---|
Merged at revision: | 34 |
Proposed branch: | lp:~pwlars/lava-test/betteroutput |
Merge into: | lp:lava-test/0.0 |
Diff against target: |
227 lines (+93/-22) 4 files modified
abrek/builtins.py (+3/-1) abrek/testdef.py (+8/-9) abrek/utils.py (+32/-1) tests/test_abrektestrunner.py (+50/-11) |
To merge this branch: | bzr merge lp:~pwlars/lava-test/betteroutput |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Linaro Infrastructure | Pending | ||
Review via email: mp+36233@code.launchpad.net |
Description of the change
This adds a -q/--quiet option for running tests, and changes default
behavior to be verbose. Some long running tests would leave the user
without feedback during the run. To do this, two util functions were
added as well. One to run commands and poll for output, and another to
mimic tee functionality so that output can optionally be sent to stdout,
and to a logfile.
To post a comment you must log in.
124 + proc = Popen(cmd, shell=True, stdout=PIPE, stderr=PIPE)
125 + while proc.poll() is None:
126 + output, err = proc.communicate()
127 + if output is not None:
128 + fd.write(output)
129 + return proc.returncode
I'm not sure what poll() does exactly but I remember writing similar code without it. Just call proc.communicate() - it blocks until the subprocess finishes. Am I missing anything?