jenkins: unitrun.sh does not generate empty system-out and system-err blocks
authorJean Privat <jean@pryen.org>
Wed, 19 Aug 2015 18:33:05 +0000 (14:33 -0400)
committerJean Privat <jean@pryen.org>
Wed, 19 Aug 2015 18:34:13 +0000 (14:34 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

misc/jenkins/unitrun.sh

index 6b1c7f5..1c3d39f 100755 (executable)
@@ -63,13 +63,21 @@ if test "$res" != "0"; then
 echo >> "${name}.xml" "<error message='Command returned $res'/>"
 echo "+ Command returned $res" >&2
 fi
+if test -s "${name}.out"; then
 cat >> "${name}.xml"<<END
 <system-out><![CDATA[
 `cat -v ${name}.out`
 ]]></system-out>
+END
+fi
+if test -s "${name}.2.out"; then
+cat >> "${name}.xml"<<END
 <system-err><![CDATA[
 `cat -v ${name}.2.out`
 ]]></system-err>
+END
+fi
+cat >> "${name}.xml"<<END
 </testcase>
 </testsuite></testsuites>
 END