xcpretty 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/Rakefile +1 -0
- data/bin/xcpretty +9 -4
- data/features/custom_reporter.feature +29 -0
- data/features/simple_format.feature +5 -0
- data/features/steps/custom_reporter_steps.rb +16 -0
- data/features/steps/formatting_steps.rb +8 -0
- data/features/steps/json_steps.rb +1 -0
- data/features/steps/report_steps.rb +5 -0
- data/features/support/env.rb +7 -1
- data/lib/xcpretty.rb +3 -2
- data/lib/xcpretty/formatters/formatter.rb +18 -6
- data/lib/xcpretty/formatters/simple.rb +4 -0
- data/lib/xcpretty/parser.rb +42 -5
- data/lib/xcpretty/printer.rb +4 -0
- data/lib/xcpretty/reporters/html.rb +3 -13
- data/lib/xcpretty/reporters/json_compilation_database.rb +4 -18
- data/lib/xcpretty/reporters/junit.rb +11 -11
- data/lib/xcpretty/reporters/reporter.rb +61 -0
- data/lib/xcpretty/syntax.rb +8 -1
- data/lib/xcpretty/version.rb +1 -1
- data/spec/fixtures/constants.rb +18 -1
- data/spec/fixtures/custom_reporter.rb +30 -0
- data/spec/fixtures/raw_xcodebuild_uitest_fail.txt +388 -0
- data/spec/xcpretty/formatters/simple_spec.rb +5 -0
- data/spec/xcpretty/parser_spec.rb +33 -2
- data/spec/xcpretty/reporters/junit_spec.rb +20 -0
- data/spec/xcpretty/reporters/reporter_spec.rb +40 -0
- metadata +35 -23
@@ -20,6 +20,11 @@ module XCPretty
|
|
20
20
|
"> Building Pods/The Spacer [Debug]"
|
21
21
|
end
|
22
22
|
|
23
|
+
it "formats build target/project/configuration with target" do
|
24
|
+
@formatter.format_aggregate_target("Be Aggro", "AggregateExample", "Debug").should ==
|
25
|
+
"> Aggregate AggregateExample/Be Aggro [Debug]"
|
26
|
+
end
|
27
|
+
|
23
28
|
it "formats analyze target/project/configuration with target" do
|
24
29
|
@formatter.format_analyze_target("The Spacer", "Pods", "Debug").should ==
|
25
30
|
"> Analyzing Pods/The Spacer [Debug]"
|
@@ -7,7 +7,6 @@ require 'fixtures/constants'
|
|
7
7
|
module XCPretty
|
8
8
|
|
9
9
|
describe Parser do
|
10
|
-
|
11
10
|
before(:each) do
|
12
11
|
@formatter = Formatter.new(false, false)
|
13
12
|
@parser = Parser.new(@formatter)
|
@@ -23,11 +22,21 @@ module XCPretty
|
|
23
22
|
@parser.parse(SAMPLE_ANALYZE_SHALLOW)
|
24
23
|
end
|
25
24
|
|
25
|
+
it "parses analyze for a C++ target" do
|
26
|
+
@formatter.should receive(:format_analyze).with("CCChip8DisplayView.cpp", "CocoaChip/CCChip8DisplayView.cpp")
|
27
|
+
@parser.parse(SAMPLE_ANALYZE_CPP)
|
28
|
+
end
|
29
|
+
|
26
30
|
it "parses build target" do
|
27
31
|
@formatter.should receive(:format_build_target).with("The Spacer", "Pods", "Debug")
|
28
32
|
@parser.parse(SAMPLE_BUILD)
|
29
33
|
end
|
30
34
|
|
35
|
+
it "parses aggregate target" do
|
36
|
+
@formatter.should receive(:format_aggregate_target).with("Be Aggro", "AggregateExample", "Debug")
|
37
|
+
@parser.parse(SAMPLE_AGGREGATE_TARGET)
|
38
|
+
end
|
39
|
+
|
31
40
|
it "parses analyze target" do
|
32
41
|
@formatter.should receive(:format_analyze_target).with("The Spacer", "Pods", "Debug")
|
33
42
|
@parser.parse(SAMPLE_ANALYZE_TARGET)
|
@@ -148,6 +157,11 @@ module XCPretty
|
|
148
157
|
@parser.parse(SAMPLE_LD)
|
149
158
|
end
|
150
159
|
|
160
|
+
it "parses Ld with relative path" do
|
161
|
+
@formatter.should receive(:format_linking).with('ObjectiveSugar', 'normal', 'i386')
|
162
|
+
@parser.parse(SAMPLE_LD_RELATIVE)
|
163
|
+
end
|
164
|
+
|
151
165
|
it "parses Libtool" do
|
152
166
|
@formatter.should receive(:format_libtool).with('libPods-ObjectiveSugarTests-Kiwi.a')
|
153
167
|
@parser.parse(SAMPLE_LIBTOOL)
|
@@ -306,6 +320,12 @@ module XCPretty
|
|
306
320
|
@parser.parse(SAMPLE_OCUNIT_PASSED_TEST_RUN_COMPLETION)
|
307
321
|
end
|
308
322
|
|
323
|
+
it "parses ocunit test assertion failure" do
|
324
|
+
@formatter.should receive(:format_failing_test).with('viewUITests.vmtAboutWindow', 'testConnectToDesktop', "UI Testing Failure - Unable to find hit point for element Button 0x608001165880: {{74.0, -54.0}, {44.0, 38.0}}, label: 'Disconnect'", '<unknown>:0')
|
325
|
+
@parser.parse(SAMPLE_OCUNIT_TEST_ASSERTION_FAILURE)
|
326
|
+
@parser.parse(SAMPLE_OCUNIT_CASE_FAILURE)
|
327
|
+
end
|
328
|
+
|
309
329
|
it "parses ocunit test run failed" do
|
310
330
|
@formatter.should receive(:format_test_run_finished).with('Macadamia.octest', '2014-09-24 23:09:20 +0000.')
|
311
331
|
@parser.parse(SAMPLE_OCUNIT_FAILED_TEST_RUN_COMPLETION)
|
@@ -479,6 +499,10 @@ module XCPretty
|
|
479
499
|
@parser.parse(reporter)
|
480
500
|
end
|
481
501
|
|
502
|
+
def given_a_test_failed(reporter = SAMPLE_OCUNIT_CASE_FAILURE)
|
503
|
+
@parser.parse(reporter)
|
504
|
+
end
|
505
|
+
|
482
506
|
def given_tests_are_done(reporter = SAMPLE_OCUNIT_TEST_RUN_COMPLETION)
|
483
507
|
@parser.parse(reporter)
|
484
508
|
end
|
@@ -519,6 +543,14 @@ module XCPretty
|
|
519
543
|
}
|
520
544
|
end
|
521
545
|
|
546
|
+
it "knows when tests fail for XCTest" do
|
547
|
+
@formatter.should_receive(:format_test_summary).once
|
548
|
+
given_tests_have_started
|
549
|
+
given_a_test_failed
|
550
|
+
given_tests_are_done
|
551
|
+
@parser.parse(SAMPLE_EXECUTED_TESTS_WITH_FAILURE)
|
552
|
+
end
|
553
|
+
|
522
554
|
it "prints OCunit / XCTest summary twice if tests executed twice" do
|
523
555
|
@formatter.should_receive(:format_test_summary).twice
|
524
556
|
2.times {
|
@@ -539,4 +571,3 @@ module XCPretty
|
|
539
571
|
|
540
572
|
end
|
541
573
|
end
|
542
|
-
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'xcpretty'
|
2
|
+
require 'tempfile'
|
3
|
+
|
4
|
+
module XCPretty
|
5
|
+
describe JUnit do
|
6
|
+
before(:each) do
|
7
|
+
@reporter_file = Tempfile.new('junit')
|
8
|
+
@formatter = JUnit.new(path: @reporter_file.path)
|
9
|
+
end
|
10
|
+
|
11
|
+
it "has name attribute in root node" do
|
12
|
+
test_name = "ReactiveCocoaTests.xctest"
|
13
|
+
@formatter.format_test_run_started(test_name)
|
14
|
+
@formatter.finish
|
15
|
+
document = REXML::Document.new(@reporter_file)
|
16
|
+
document.root.attributes['name'].should == test_name
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'xcpretty'
|
4
|
+
require 'fixtures/constants'
|
5
|
+
|
6
|
+
module XCPretty
|
7
|
+
|
8
|
+
describe Reporter do
|
9
|
+
|
10
|
+
before(:each) do
|
11
|
+
@reporter = Reporter.new(path: "example_file")
|
12
|
+
end
|
13
|
+
|
14
|
+
it "reports a passing test" do
|
15
|
+
@reporter.format_passing_test("RACCommandSpec", "_tupleByAddingObject__should_add_a_non_nil_object", "0.001")
|
16
|
+
expect(@reporter.tests).to include("_tupleByAddingObject__should_add_a_non_nil_object PASSED")
|
17
|
+
end
|
18
|
+
|
19
|
+
it "reports a failing test" do
|
20
|
+
@reporter.format_failing_test("RACCommandSpec", "enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES", "expected: 1, got: 0", 'path/to/file')
|
21
|
+
expect(@reporter.tests).to include("enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES in path/to/file FAILED: expected: 1, got: 0")
|
22
|
+
end
|
23
|
+
|
24
|
+
it "reports a pending test" do
|
25
|
+
@reporter.format_pending_test("RACCommandSpec", "_tupleByAddingObject__should_add_a_non_nil_object")
|
26
|
+
expect(@reporter.tests).to include("_tupleByAddingObject__should_add_a_non_nil_object IS PENDING")
|
27
|
+
end
|
28
|
+
|
29
|
+
it "writes to disk" do
|
30
|
+
@reporter.format_passing_test("RACCommandSpec", "_tupleByAddingObject__should_add_a_non_nil_object", "0.001")
|
31
|
+
file = double("file stub")
|
32
|
+
File.should_receive(:open).with("example_file", "w").and_yield(file)
|
33
|
+
file.should_receive(:write).with("_tupleByAddingObject__should_add_a_non_nil_object PASSED\nFINISHED RUNNING 1 TESTS WITH 0 FAILURES")
|
34
|
+
@reporter.write_report
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xcpretty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marin Usalj
|
@@ -9,90 +9,90 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rouge
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - ~>
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: '1.8'
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - ~>
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: '1.8'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - ~>
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: '1.3'
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ~>
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '1.3'
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: rake
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - '>='
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: '0'
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - '>='
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '0'
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: rubocop
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
|
-
- -
|
60
|
+
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
62
|
version: 0.34.0
|
63
63
|
type: :development
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
|
-
- -
|
67
|
+
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
69
|
version: 0.34.0
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: rspec
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
73
73
|
requirements:
|
74
|
-
- -
|
74
|
+
- - ~>
|
75
75
|
- !ruby/object:Gem::Version
|
76
76
|
version: '2.0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
79
|
version_requirements: !ruby/object:Gem::Requirement
|
80
80
|
requirements:
|
81
|
-
- -
|
81
|
+
- - ~>
|
82
82
|
- !ruby/object:Gem::Version
|
83
83
|
version: '2.0'
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: cucumber
|
86
86
|
requirement: !ruby/object:Gem::Requirement
|
87
87
|
requirements:
|
88
|
-
- -
|
88
|
+
- - ~>
|
89
89
|
- !ruby/object:Gem::Version
|
90
90
|
version: '1.0'
|
91
91
|
type: :development
|
92
92
|
prerelease: false
|
93
93
|
version_requirements: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - ~>
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '1.0'
|
98
98
|
description: "\n Xcodebuild formatter designed to be piped with `xcodebuild`,\n
|
@@ -106,11 +106,11 @@ executables:
|
|
106
106
|
extensions: []
|
107
107
|
extra_rdoc_files: []
|
108
108
|
files:
|
109
|
-
-
|
110
|
-
-
|
111
|
-
-
|
112
|
-
-
|
113
|
-
-
|
109
|
+
- .gitignore
|
110
|
+
- .hound.yml
|
111
|
+
- .kick
|
112
|
+
- .rubocop.yml
|
113
|
+
- .travis.yml
|
114
114
|
- CHANGELOG.md
|
115
115
|
- CONTRIBUTING.md
|
116
116
|
- Gemfile
|
@@ -122,12 +122,14 @@ files:
|
|
122
122
|
- features/assets/RACCommandSpec, line 80, hello xcpretty.png
|
123
123
|
- features/assets/apple_raw.png
|
124
124
|
- features/custom_formatter.feature
|
125
|
+
- features/custom_reporter.feature
|
125
126
|
- features/fixtures/xcodebuild.log
|
126
127
|
- features/html_report.feature
|
127
128
|
- features/json_compilation_database_report.feature
|
128
129
|
- features/junit_report.feature
|
129
130
|
- features/knock_format.feature
|
130
131
|
- features/simple_format.feature
|
132
|
+
- features/steps/custom_reporter_steps.rb
|
131
133
|
- features/steps/formatting_steps.rb
|
132
134
|
- features/steps/html_steps.rb
|
133
135
|
- features/steps/json_steps.rb
|
@@ -150,6 +152,7 @@ files:
|
|
150
152
|
- lib/xcpretty/reporters/html.rb
|
151
153
|
- lib/xcpretty/reporters/json_compilation_database.rb
|
152
154
|
- lib/xcpretty/reporters/junit.rb
|
155
|
+
- lib/xcpretty/reporters/reporter.rb
|
153
156
|
- lib/xcpretty/snippet.rb
|
154
157
|
- lib/xcpretty/syntax.rb
|
155
158
|
- lib/xcpretty/term.rb
|
@@ -157,10 +160,12 @@ files:
|
|
157
160
|
- spec/fixtures/NSStringTests.m
|
158
161
|
- spec/fixtures/constants.rb
|
159
162
|
- spec/fixtures/custom_formatter.rb
|
163
|
+
- spec/fixtures/custom_reporter.rb
|
160
164
|
- spec/fixtures/oneliner.m
|
161
165
|
- spec/fixtures/raw_kiwi_compilation_fail.txt
|
162
166
|
- spec/fixtures/raw_kiwi_fail.txt
|
163
167
|
- spec/fixtures/raw_specta_fail.txt
|
168
|
+
- spec/fixtures/raw_xcodebuild_uitest_fail.txt
|
164
169
|
- spec/spec_helper.rb
|
165
170
|
- spec/support/matchers/colors.rb
|
166
171
|
- spec/xcpretty/ansi_spec.rb
|
@@ -169,6 +174,8 @@ files:
|
|
169
174
|
- spec/xcpretty/formatters/simple_spec.rb
|
170
175
|
- spec/xcpretty/parser_spec.rb
|
171
176
|
- spec/xcpretty/printer_spec.rb
|
177
|
+
- spec/xcpretty/reporters/junit_spec.rb
|
178
|
+
- spec/xcpretty/reporters/reporter_spec.rb
|
172
179
|
- spec/xcpretty/snippet_spec.rb
|
173
180
|
- spec/xcpretty/syntax_spec.rb
|
174
181
|
- spec/xcpretty/term_spec.rb
|
@@ -183,17 +190,17 @@ require_paths:
|
|
183
190
|
- lib
|
184
191
|
required_ruby_version: !ruby/object:Gem::Requirement
|
185
192
|
requirements:
|
186
|
-
- -
|
193
|
+
- - '>='
|
187
194
|
- !ruby/object:Gem::Version
|
188
195
|
version: 2.0.0
|
189
196
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
197
|
requirements:
|
191
|
-
- -
|
198
|
+
- - '>='
|
192
199
|
- !ruby/object:Gem::Version
|
193
200
|
version: '0'
|
194
201
|
requirements: []
|
195
202
|
rubyforge_project:
|
196
|
-
rubygems_version: 2.
|
203
|
+
rubygems_version: 2.0.14.1
|
197
204
|
signing_key:
|
198
205
|
specification_version: 4
|
199
206
|
summary: xcodebuild formatter done right
|
@@ -201,12 +208,14 @@ test_files:
|
|
201
208
|
- features/assets/RACCommandSpec, line 80, hello xcpretty.png
|
202
209
|
- features/assets/apple_raw.png
|
203
210
|
- features/custom_formatter.feature
|
211
|
+
- features/custom_reporter.feature
|
204
212
|
- features/fixtures/xcodebuild.log
|
205
213
|
- features/html_report.feature
|
206
214
|
- features/json_compilation_database_report.feature
|
207
215
|
- features/junit_report.feature
|
208
216
|
- features/knock_format.feature
|
209
217
|
- features/simple_format.feature
|
218
|
+
- features/steps/custom_reporter_steps.rb
|
210
219
|
- features/steps/formatting_steps.rb
|
211
220
|
- features/steps/html_steps.rb
|
212
221
|
- features/steps/json_steps.rb
|
@@ -220,10 +229,12 @@ test_files:
|
|
220
229
|
- spec/fixtures/NSStringTests.m
|
221
230
|
- spec/fixtures/constants.rb
|
222
231
|
- spec/fixtures/custom_formatter.rb
|
232
|
+
- spec/fixtures/custom_reporter.rb
|
223
233
|
- spec/fixtures/oneliner.m
|
224
234
|
- spec/fixtures/raw_kiwi_compilation_fail.txt
|
225
235
|
- spec/fixtures/raw_kiwi_fail.txt
|
226
236
|
- spec/fixtures/raw_specta_fail.txt
|
237
|
+
- spec/fixtures/raw_xcodebuild_uitest_fail.txt
|
227
238
|
- spec/spec_helper.rb
|
228
239
|
- spec/support/matchers/colors.rb
|
229
240
|
- spec/xcpretty/ansi_spec.rb
|
@@ -232,7 +243,8 @@ test_files:
|
|
232
243
|
- spec/xcpretty/formatters/simple_spec.rb
|
233
244
|
- spec/xcpretty/parser_spec.rb
|
234
245
|
- spec/xcpretty/printer_spec.rb
|
246
|
+
- spec/xcpretty/reporters/junit_spec.rb
|
247
|
+
- spec/xcpretty/reporters/reporter_spec.rb
|
235
248
|
- spec/xcpretty/snippet_spec.rb
|
236
249
|
- spec/xcpretty/syntax_spec.rb
|
237
250
|
- spec/xcpretty/term_spec.rb
|
238
|
-
has_rdoc:
|