1 |
#!/bin/bash
|
2 |
|
3 |
xml="$1"
|
4 |
|
5 |
tests_res="$2" # 0 -> ok, 1 -> fail, (2 -> skipped)
|
6 |
|
7 |
tests_name="$3"
|
8 |
tests_header="$4"
|
9 |
tests_message="$5"
|
10 |
tests_rtime="$6"
|
11 |
|
12 |
tests_name=`echo "$tests_name" | tr '<"> \\&' '_'`
|
13 |
tests_header=`echo "$tests_header" | tr '<"> \\&' '_'`
|
14 |
tests_message=`echo "$tests_message" | tr '<"> \\&' '_'`
|
15 |
tests_rtime=`echo "$tests_rtime" | tr '<"> \\&' '_'`
|
16 |
|
17 |
|
18 |
if [ "$tests_res""x" == "0x" ]; then
|
19 |
|
20 |
echo ' <testcase classname="JUnitXmlReporter.constructor" name="'"$tests_name"'" time="'"$tests_rtime"'" />' >> "$xml"
|
21 |
|
22 |
else
|
23 |
|
24 |
echo ' <testcase classname="JUnitXmlReporter.constructor" name="'"$tests_name"'" time="'"$tests_rtime"'">
|
25 |
<failure message="'"$tests_header"'">'"$tests_message"'</failure>
|
26 |
</testcase>' >> "$xml"
|
27 |
|
28 |
fi
|
29 |
|
30 |
|