diff options
| author | Manuel Traut <manut@linutronix.de> | 2017-11-22 13:02:23 +0100 |
|---|---|---|
| committer | Manuel Traut <manut@linutronix.de> | 2017-11-22 13:02:23 +0100 |
| commit | b13cc86c9f9e2f6919b2803ff2d7f141e4d37cad (patch) | |
| tree | 61488461a9a07e5b8c309564360bea5caf8d08a2 | |
| parent | 52af67766572fa8a61fd3d30094a1faa24614982 (diff) | |
reprint stdout and stderr
if pyjutest is used in e.g. jenkins and a command after the pyjutest call and
before archiving the unit file fails, the output of the command is lost.
To avoid this, pyjutest now redirects the original output of the
command.
Signed-off-by: Manuel Traut <manut@linutronix.de>
| -rwxr-xr-x | pyjutest | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -4,6 +4,8 @@ # # pyjutest - junit xml generator +from __future__ import print_function + from junit_xml import TestSuite, TestCase from pickle import dump, load from subprocess import Popen, PIPE, STDOUT @@ -42,3 +44,10 @@ with open('pyjutest.dat', 'wb') as dat: with open('pyjutest.xml', 'w') as xml: TestSuite.to_file(xml, tss, prettyprint=True) + +print("%s STDOUT:" % sys.argv[1]) +for l in out.decode().split("\n"): + print(l) +print("%s STDERR:" % sys.argv[1]) +for l in err.decode().split("\n"): + print(l, file=sys.stderr) |
