ocunit2junit 1.3 → 1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +6 -14
- data/bin/ocunit2junit +41 -12
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
OGMwZGM1OThlMTFhNTlmZTYxOGEyNzJiYjE3ZDVhMGRkZjU2YmExYzdlNzAz
|
10
|
-
MWEyMDM4ODRmMTU0YzNjYmI5ZjE1NjU3ZGYzMDkzNTRmMzdjNjhhZWExZmNh
|
11
|
-
OWE4OWM5OTI2M2U1NDgwZDVmYjY2OTc1NjQ0N2VmODdkYmNjMjU=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
MjI3MGUxYWE4ZjdmODdmMmExODM2NmJmOWZiNzFjNDgwODU5Njc0OWY2NjBi
|
14
|
-
NWNlYjliYjEwMGRkNjY4YmNlMDU0ZjQ5OTgyNGNmNWFkZmNjNmQ0OTMzMGQ5
|
15
|
-
MDQ5MDZkNTJmZTlhOThhYmVjNmJiNjExOWNkZTcxM2M1MTk3M2E=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 787d3da20d2f47b028216ff35dc90984f6bad839
|
4
|
+
data.tar.gz: ac93827a865ed1cc42f28523619da4649badc5b1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 7d1410c5a999f9c930ada4bef9e121acd7758d8fc2d575a4872be4e11946003aee81d2bba3ad7b41a699cdf077a871ea9ea4d51eeb9e1d2dce22483449e33552
|
7
|
+
data.tar.gz: 4bc41ad9991bd2521dce9165ff7345df3ad92bfc364685ac22eb4124a3e3839ed9293a9116a6fbb62473848e99859345de3e272aac26f1ee12e1c4c98975792d
|
data/bin/ocunit2junit
CHANGED
@@ -19,8 +19,8 @@
|
|
19
19
|
#
|
20
20
|
#
|
21
21
|
# Where to put the XML-files from your unit tests
|
22
|
-
TEST_REPORTS_FOLDER = "test-reports"
|
23
|
-
SUPPORT_KIWI = true
|
22
|
+
TEST_REPORTS_FOLDER = ENV.has_key?('TEST_REPORTS_FOLDER') ? ENV['TEST_REPORTS_FOLDER'] : "test-reports"
|
23
|
+
SUPPORT_KIWI = ENV.has_key?('SUPPORT_KIWI') ? ENV['SUPPORT_KIWI'] : true
|
24
24
|
#
|
25
25
|
#
|
26
26
|
# Don't edit below this line
|
@@ -39,20 +39,29 @@ class ReportParser
|
|
39
39
|
@exit_code = 0
|
40
40
|
|
41
41
|
FileUtils.rm_rf(TEST_REPORTS_FOLDER)
|
42
|
-
FileUtils.
|
42
|
+
FileUtils.mkdir_p(TEST_REPORTS_FOLDER)
|
43
43
|
parse_input
|
44
44
|
end
|
45
45
|
|
46
46
|
private
|
47
47
|
|
48
48
|
def parse_input
|
49
|
-
@piped_input.each
|
50
|
-
|
51
|
-
|
49
|
+
if @piped_input.respond_to?(:each)
|
50
|
+
line_enumerator = @piped_input.each
|
51
|
+
elsif @piped_input.respond_to?(:each_line)
|
52
|
+
line_enumerator = @piped_input.each_line
|
53
|
+
end
|
54
|
+
|
55
|
+
line_enumerator.each do |piped_row|
|
56
|
+
if piped_row.respond_to?("encode!")
|
57
|
+
temporary_encoding = (RUBY_VERSION == '1.9.2') ? 'UTF-8' : 'UTF-16'
|
58
|
+
piped_row.encode!(temporary_encoding, 'UTF-8', :invalid => :replace, :replace => '')
|
59
|
+
piped_row.encode!('UTF-8', temporary_encoding)
|
60
|
+
end
|
52
61
|
puts piped_row
|
53
62
|
|
54
63
|
description_results = piped_row.scan(/\s\'(.+)\'\s/)
|
55
|
-
if description_results
|
64
|
+
if description_results && description_results[0] && description_results[0]
|
56
65
|
description = description_results[0][0]
|
57
66
|
end
|
58
67
|
|
@@ -66,7 +75,15 @@ class ReportParser
|
|
66
75
|
when /Test Suite '(\S+)'.*finished at\s+(.*)./
|
67
76
|
t = Time.parse($2.to_s)
|
68
77
|
handle_end_test_suite($1,t)
|
69
|
-
|
78
|
+
|
79
|
+
when /Test Suite '(\S+)'.*passed at\s+(.*)./
|
80
|
+
t = Time.parse($2.to_s)
|
81
|
+
handle_end_test_suite($1,t)
|
82
|
+
|
83
|
+
when /Test Suite '(\S+)'.*failed at\s+(.*)./
|
84
|
+
t = Time.parse($2.to_s)
|
85
|
+
handle_end_test_suite($1,t)
|
86
|
+
|
70
87
|
when /Test Case '-\[\S+\s+(\S+)\]' started./
|
71
88
|
test_case = $1
|
72
89
|
@last_description = nil
|
@@ -96,7 +113,7 @@ class ReportParser
|
|
96
113
|
@exit_code = -1;
|
97
114
|
end
|
98
115
|
|
99
|
-
|
116
|
+
if description
|
100
117
|
@last_description = description
|
101
118
|
end
|
102
119
|
end
|
@@ -157,8 +174,10 @@ class ReportParser
|
|
157
174
|
end
|
158
175
|
|
159
176
|
def handle_test_error(test_suite,test_case,error_message,error_location)
|
160
|
-
#
|
161
|
-
@errors[test_case]
|
177
|
+
# Only record the first error for a test_case
|
178
|
+
if @errors[test_case].nil?
|
179
|
+
@errors[test_case] = [ error_message, error_location ]
|
180
|
+
end
|
162
181
|
end
|
163
182
|
|
164
183
|
def handle_test_failed(test_case,test_case_duration)
|
@@ -167,8 +186,18 @@ class ReportParser
|
|
167
186
|
end
|
168
187
|
|
169
188
|
def get_test_case_name(test_case, description)
|
170
|
-
|
189
|
+
# Kiwi 1.x
|
190
|
+
if SUPPORT_KIWI && test_case == "example" && description
|
171
191
|
description
|
192
|
+
# Kiwi 2.x
|
193
|
+
elsif SUPPORT_KIWI && test_case =~ /(.+_)+(Should.+)(_.+)*/
|
194
|
+
test_case.gsub(/([A-Z])([A-Z][a-z]+)/, ' \1 \2')
|
195
|
+
.gsub(/([A-Z][a-z]+)/, ' \1')
|
196
|
+
.gsub(/([A-Z][A-Z]+)/, ' \1')
|
197
|
+
.gsub(/([^A-Za-z ]+)/, ' \1')
|
198
|
+
.gsub(/\s+/, ' ')
|
199
|
+
.split(" _ ")[1..-1].join(", ")
|
200
|
+
.downcase.capitalize
|
172
201
|
else
|
173
202
|
test_case
|
174
203
|
end
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ocunit2junit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '1.
|
4
|
+
version: '1.4'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Christian Hedin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description:
|
13
|
+
description: 'Simply pipe your xcodebuild output through ocunit2junit: xcodebuild
|
14
14
|
... | ocunit2junit.rb'
|
15
15
|
email:
|
16
16
|
executables:
|
@@ -28,18 +28,19 @@ require_paths:
|
|
28
28
|
- lib
|
29
29
|
required_ruby_version: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
35
35
|
requirements:
|
36
|
-
- -
|
36
|
+
- - '>='
|
37
37
|
- !ruby/object:Gem::Version
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|
40
40
|
rubyforge_project:
|
41
|
-
rubygems_version: 2.
|
41
|
+
rubygems_version: 2.1.11
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: A script that converts OCUnit (and Kiwi) output to JUnit style XML output.
|
45
45
|
test_files: []
|
46
|
+
has_rdoc:
|