summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManuel Traut <manut@linutronix.de>2017-11-22 13:02:23 +0100
committerManuel Traut <manut@linutronix.de>2017-11-22 13:02:23 +0100
commitb13cc86c9f9e2f6919b2803ff2d7f141e4d37cad (patch)
tree61488461a9a07e5b8c309564360bea5caf8d08a2
parent52af67766572fa8a61fd3d30094a1faa24614982 (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-xpyjutest9
1 files changed, 9 insertions, 0 deletions
diff --git a/pyjutest b/pyjutest
index 68d916e..c3261d7 100755
--- a/pyjutest
+++ b/pyjutest
@@ -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)