File tree 1 file changed +11
-6
lines changed
1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- head=' <?xml version="1.0"?>\n<testsuite>'
3
+ head=' <?xml version="1.0"?>\n<testsuite name="BatsTests" tests="%d" >'
4
4
foot=' </testsuite>'
5
5
6
- test=' <testcase file="%s" name="%s" time="%d" />'
6
+ test=' <testcase file="%s" classname="%s" time="%d" />'
7
+
8
+
9
+ header (){
10
+ line=" $1 "
11
+ count=$( expr " $line " : ' 1..\([0-9]*\)' )
12
+ printf " $head " $count
13
+ }
7
14
8
15
parse_it (){
9
- $line =$1
10
16
NAME=$( expr " $line " : ' .*ok [0-9]* \(.*\) #time.*' )
11
17
TIME=$( expr " $line " : ' .*ok [0-9]*.*\#time=\(.*\)' )
12
18
printf " ${test} " " ${NAME} " " ${NAME} " ${TIME}
13
19
}
14
20
15
21
16
- printf " $head "
17
22
18
23
while read -r line; do
19
24
case $line in
20
- 1..* ) continue ;;
21
- ok* ) parse_it $line ;;
25
+ 1..* ) header ;;
26
+ ok* ) parse_it;;
22
27
\# * ) continue ;;
23
28
* ) echo " unkon line" ;;
24
29
esac
You can’t perform that action at this time.
0 commit comments