xcpretty 0.2.7 → 0.2.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3ccb8da9a9faceb76048904874841b998c79fd79
4
- data.tar.gz: e8e041e96f12c775f041d272c8a0fc91b7ef0ce3
3
+ metadata.gz: 2bb4b65256b40fe5bee3a81340f8eaec2e6d89e9
4
+ data.tar.gz: a3a15b2b03d76a11c779b068ca4f1f8b6e042102
5
5
  SHA512:
6
- metadata.gz: f5effe020578c7d62747e014de2db8ab576c00e25e4bd8ea589d0b76412a76177d94129b0c7a52f7219771f63127f31ae8e3fa4501f74740f05617ecee7067c4
7
- data.tar.gz: d922a8c4090687f3548f9a7ddec00a5482cf2c5661403a2b9888f166c5bc1ab5941fecd43d661a3c0f149e6dafe44684f631591ff14b3a80222e5fa22f840198
6
+ metadata.gz: 9b6ef025667ea71cf6fcce726772b9823c58375cad4dd8bed8b81c5017cfef56ae1f0efda5ea5d13b08bff3c46b7c32469f5f0739de32918db9801ec2c9bdf7d
7
+ data.tar.gz: f087e6b8297c96076647c43bc6a6b224c62c2ab8a9a6784c8b7bdd81ffece61a74095016a567a1684cb51274e2f9e306f059035e6b0b40b582d474e735a86d78
@@ -30,7 +30,8 @@
30
30
  .test.passing { background-color: #CAF59F;}
31
31
  .test.failing.odd { background-color: #EEC7CC;}
32
32
  .test.passing.odd { background-color: #E5FBCF;}
33
- .details { background-color: #F4DDE0; border: 1px solid #C84F5E;}
33
+ .details.failing { background-color: #F4DDE0; border: 1px solid #C84F5E;}
34
+ .details.passing { background-color: #E5F4DC; border: 1px solid #A1D761;}
34
35
  .test .test-detail:last-child { padding-bottom: 8px;}
35
36
  .test .title { float: left; font-size: 0.9em; margin-top: 8px; font-family: Menlo, Monaco, monospace;}
36
37
  .test .time { float: left;margin: 4px 10px 0 20px;}
@@ -127,15 +128,6 @@
127
128
  <h3 class="title"><%= name %></h3>
128
129
  </section>
129
130
  <section class="tests">
130
- <% unless info[:screenshots].empty? %>
131
- <div class="screenshots <%= info[:failing] ? 'failing' : 'passing'%>">
132
- <% info[:screenshots].each_with_index do |screenshot, index| %>
133
- <a href="javascript:toggleScreenshot('<%=name %>', <%=index %>)">
134
- <img class="screenshot" id="screenshot-<%=name %>-<%=index %>" src="<%=screenshot %>" />
135
- </a>
136
- <% end %>
137
- </div>
138
- <% end %>
139
131
  <table>
140
132
  <% info[:tests].each_with_index do |test, index| %>
141
133
  <% detail_class = test[:name].gsub(/\s/,'') %>
@@ -147,8 +139,8 @@
147
139
  </td>
148
140
  <td><h3 class="title"><%= test[:name] %></h3></td>
149
141
  </tr>
150
- <% if test[:reason] || test[:snippet] %>
151
- <tr class="details <%= detail_class %>">
142
+ <% if test[:reason] || test[:snippet] || !test[:screenshots].empty? %>
143
+ <tr class="details <%= test[:failing] ? 'failing' : 'passing'%> <%= detail_class %>">
152
144
  <td></td>
153
145
  <td>
154
146
  <% if test[:reason] %>
@@ -158,6 +150,15 @@
158
150
  <section class="test-detail snippet"><%= test[:snippet] %></section>
159
151
  <section class="test-detail"><%= test[:file] %></section>
160
152
  <% end %>
153
+ <% if !test[:screenshots].empty? %>
154
+ <section class="test-detail">
155
+ <% test[:screenshots].each_with_index do |screenshot, idx| %>
156
+ <a href="javascript:toggleScreenshot('<%=test[:name] %>', <%=index %>)">
157
+ <img class="screenshot" id="screenshot-<%=test[:name] %>-<%=index %>" src="<%=screenshot %>" />
158
+ </a>
159
+ <% end %>
160
+ </section>
161
+ <% end %>
161
162
  </td>
162
163
  </tr>
163
164
  <% end %>
@@ -254,6 +254,7 @@ module XCPretty
254
254
  # $2 = file path
255
255
  FILE_MISSING_ERROR_MATCHER = /^<unknown>:0:\s(error:\s.*)\s'(\/.+\/.*\..*)'$/
256
256
 
257
+ # @regex Captured groups
257
258
  # $1 = whole error
258
259
  LD_ERROR_MATCHER = /^(ld:.*)/
259
260
 
@@ -280,6 +281,10 @@ module XCPretty
280
281
  # @regex Captured groups
281
282
  # $1 = reference
282
283
  SYMBOL_REFERENCED_FROM_MATCHER = /\s+"(.*)", referenced from:$/
284
+
285
+ # @regex Captured groups
286
+ # $1 = error reason
287
+ MODULE_INCLUDES_ERROR_MATCHER = /^\<module-includes\>:.*?:.*?:\s(?:fatal\s)?(error:\s.*)$/
283
288
  end
284
289
  end
285
290
 
@@ -368,6 +373,8 @@ module XCPretty
368
373
  formatter.format_libtool($1)
369
374
  when LINKING_MATCHER
370
375
  formatter.format_linking($1, $2, $3)
376
+ when MODULE_INCLUDES_ERROR_MATCHER
377
+ formatter.format_error($1)
371
378
  when TEST_CASE_MEASURED_MATCHER
372
379
  formatter.format_measuring_test($1, $2, $3)
373
380
  when TEST_CASE_PENDING_MATCHER
@@ -27,11 +27,12 @@ module XCPretty
27
27
  def format_failing_test(suite, test_case, reason, file)
28
28
  add_test(suite, name: test_case, failing: true,
29
29
  reason: reason, file: file,
30
- snippet: formatted_snippet(file))
30
+ snippet: formatted_snippet(file),
31
+ screenshots: [])
31
32
  end
32
33
 
33
34
  def format_passing_test(suite, test_case, time)
34
- add_test(suite, name: test_case, time: time)
35
+ add_test(suite, name: test_case, time: time, screenshots: [])
35
36
  end
36
37
 
37
38
  private
@@ -41,10 +42,9 @@ module XCPretty
41
42
  Syntax.highlight_html(snippet)
42
43
  end
43
44
 
44
-
45
45
  def add_test(suite_name, data)
46
46
  @test_count += 1
47
- @test_suites[suite_name] ||= {tests: [], screenshots: []}
47
+ @test_suites[suite_name] ||= {tests: []}
48
48
  @test_suites[suite_name][:tests] << data
49
49
  if data[:failing]
50
50
  @test_suites[suite_name][:failing] = true
@@ -70,19 +70,21 @@ module XCPretty
70
70
  Dir.foreach(SCREENSHOT_DIR) do |item|
71
71
  next if item == '.' || item == '..' || File.extname(item) != '.png'
72
72
 
73
- suite = item.split(".")
74
- next if suite.empty?
75
-
76
- suite_name = find_test_suite(suite[0])
77
- next if suite_name.nil?
73
+ test = find_test(item)
74
+ next if test.nil?
78
75
 
79
- @test_suites[suite_name][:screenshots] << item
76
+ test[:screenshots] << item
80
77
  end
81
78
  end
82
79
 
83
- def find_test_suite(image_name)
84
- @test_suites.each do |key, value|
85
- return key if image_name.start_with?(key.split('.').last)
80
+ def find_test(image_name)
81
+ @test_suites.each do |name, info|
82
+ info[:tests].each do |test, index|
83
+ combined_name = name + '_' + test[:name]
84
+ test_name_matches = image_name.start_with?(test[:name])
85
+ combined_name_matches = image_name.start_with?(combined_name)
86
+ return test if test_name_matches || combined_name_matches
87
+ end
86
88
  end
87
89
  nil
88
90
  end
@@ -1,4 +1,4 @@
1
1
  module XCPretty
2
- VERSION = "0.2.7"
2
+ VERSION = "0.2.8"
3
3
  end
4
4
 
@@ -64,7 +64,7 @@ Clean.Remove clean /Users/musalj/Library/Developer/Xcode/DerivedData/ObjectiveSu
64
64
  )
65
65
  SAMPLE_EXECUTED_TESTS = "Executed 4 tests, with 0 failures (0 unexpected) in 0.003 (0.004) seconds"
66
66
  SAMPLE_SPECTA_EXECUTED_TESTS = " Executed 4 tests, with 0 failures (0 unexpected) in 10.192 (10.193) seconds"
67
- SAMPLE_OCUNIT_TEST = "Test Case '-[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES]' passed (0.001 seconds)."
67
+ SAMPLE_OCUNIT_TEST = "Test Case '-[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES]' passed (0.001 seconds)."
68
68
  SAMPLE_SPECTA_TEST = " Test Case '-[SKWelcomeActivationViewControllerSpecSpec SKWelcomeActivationViewController_When_a_user_enters_their_details_lets_them_enter_a_valid_manager_code]' passed (0.725 seconds)."
69
69
  SAMPLE_SLOWISH_TEST = "Test Case '-[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES]' passed (0.026 seconds)."
70
70
  SAMPLE_SLOW_TEST = "Test Case '-[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES]' passed (0.101 seconds)."
@@ -555,7 +555,7 @@ PBXCp build/Release/CocoaChipCore.framework build/Release/CocoaChip.app/Contents
555
555
  warning: skipping copy phase strip, binary is code signed: /Users/dustin/Source/CocoaChip/build/Release/CocoaChipCore.framework/Versions/A/CocoaChipCore
556
556
  )
557
557
 
558
- SAMPLE_SCREENSHOT_FILE = 'RACCommandSpec, line 80, hello xcpretty.png'
558
+ SAMPLE_SCREENSHOT_FILE = 'RACCommandSpec_enabled_signal_should_send_YES_while_executing_is_YES.png'
559
559
  SAMPLE_UNRELATED_IMAGE_FILE = 'apple_raw.png'
560
560
 
561
561
  ################################################################################
@@ -657,6 +657,8 @@ SAMPLE_SWIFT_UNAVAILABLE = "Swift is unavailable on iOS earlier than 7.0; please
657
657
 
658
658
  SAMPLE_USE_LEGACY_SWIFT = "“Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configured correctly for targets which use Swift. Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settings editor to configure the build setting directly."
659
659
 
660
+ SAMPLE_MODULE_INCLUDES_ERROR = "<module-includes>:1:1: error: umbrella header for module 'ModuleName' does not include header 'Header.h'"
661
+
660
662
  ################################################################################
661
663
  # WARNINGS
662
664
  ################################################################################
@@ -201,7 +201,7 @@ module XCPretty
201
201
 
202
202
  it "parses passing ocunit tests" do
203
203
  @formatter.should receive(:format_passing_test).with('RACCommandSpec',
204
- 'enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES',
204
+ 'enabled_signal_should_send_YES_while_executing_is_YES',
205
205
  '0.001')
206
206
  @parser.parse(SAMPLE_OCUNIT_TEST)
207
207
  end
@@ -523,6 +523,13 @@ module XCPretty
523
523
  @formatter.should receive(:format_error)
524
524
  @parser.parse(SAMPLE_CODE_SIGNING_IS_REQUIRED_ERROR)
525
525
  end
526
+
527
+ it "parses module includes error" do
528
+ @formatter.should receive(:format_error).with(
529
+ "error: umbrella header for module 'ModuleName' does not include header 'Header.h'"
530
+ )
531
+ @parser.parse(SAMPLE_MODULE_INCLUDES_ERROR)
532
+ end
526
533
  end
527
534
 
528
535
  context "warnings" do
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.7
4
+ version: 0.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marin Usalj
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-27 00:00:00.000000000 Z
12
+ date: 2017-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rouge
@@ -119,7 +119,7 @@ files:
119
119
  - Rakefile
120
120
  - assets/report.html.erb
121
121
  - bin/xcpretty
122
- - features/assets/RACCommandSpec, line 80, hello xcpretty.png
122
+ - features/assets/RACCommandSpec_enabled_signal_should_send_YES_while_executing_is_YES.png
123
123
  - features/assets/apple_raw.png
124
124
  - features/custom_formatter.feature
125
125
  - features/custom_reporter.feature
@@ -204,7 +204,7 @@ signing_key:
204
204
  specification_version: 4
205
205
  summary: xcodebuild formatter done right
206
206
  test_files:
207
- - features/assets/RACCommandSpec, line 80, hello xcpretty.png
207
+ - features/assets/RACCommandSpec_enabled_signal_should_send_YES_while_executing_is_YES.png
208
208
  - features/assets/apple_raw.png
209
209
  - features/custom_formatter.feature
210
210
  - features/custom_reporter.feature