xcpretty 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +6 -0
- data/CHANGELOG.md +18 -11
- data/bin/xcpretty +1 -2
- data/features/simple_format.feature +12 -6
- data/features/steps/formatting_steps.rb +15 -4
- data/features/steps/xcpretty_steps.rb +17 -0
- data/features/support/env.rb +1 -0
- data/features/xcpretty.feature +9 -1
- data/lib/xcpretty/formatters/formatter.rb +49 -28
- data/lib/xcpretty/formatters/simple.rb +0 -10
- data/lib/xcpretty/parser.rb +44 -3
- data/lib/xcpretty/version.rb +1 -1
- data/spec/fixtures/constants.rb +16 -0
- data/spec/xcpretty/formatters/formatter_spec.rb +32 -0
- data/spec/xcpretty/formatters/simple_spec.rb +0 -18
- data/spec/xcpretty/parser_spec.rb +37 -10
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f16b8cdb8adbca7bab18e22d17e2cabe5206690
|
4
|
+
data.tar.gz: cb2aae6650997789d1ecdc78e90f8677447f95e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2868e89fa5c2df41b362696dd3aac87b66ebf3826f5d356a5d5a5722c75837cb29097f41cc941854103b59001b615eec9b29955bfedf4b8e4603089b36d5e5e1
|
7
|
+
data.tar.gz: c886ff1f3ddec6d5cf4313212ff49780ebeeb5e9365f02203dac0d6521788849cc90f678b29c8bf80dd86c15d76c18393dbbcab7274f3748b8d84d536463c292
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,22 +1,31 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## 0.0.8
|
4
|
+
|
5
|
+
###### Bug Fixes
|
6
|
+
|
7
|
+
* show version if not piped [#39](https://github.com/mneorr/XCPretty/issues/39)
|
4
8
|
|
5
9
|
###### Enhancements
|
6
10
|
|
7
|
-
*
|
11
|
+
* format linker failures (Undefined symbols for arch...)
|
12
|
+
|
8
13
|
|
14
|
+
## 0.0.7
|
15
|
+
|
16
|
+
###### Enhancements
|
17
|
+
|
18
|
+
* exit(1) if xcodebuild failure detected
|
9
19
|
* Print compile errors nicely. Currently we support compiler erorrs,
|
10
20
|
and Pods-not-installed errors. Missing mach-o-linker failures
|
11
|
-
|
12
21
|
* Added support for loading arbitrary custom printers (experimental) |
|
13
22
|
[Eloy Durán](https://github.com/alloy) |
|
14
23
|
[#29](https://github.com/mneorr/xcpretty/pulls/29)
|
15
|
-
|
16
24
|
* Show help banner in case no data is piped in |
|
17
25
|
[Eloy Durán](https://github.com/alloy) |
|
18
26
|
[#29](https://github.com/mneorr/xcpretty/pulls/29)
|
19
27
|
|
28
|
+
|
20
29
|
## 0.0.6
|
21
30
|
|
22
31
|
###### Enhancements
|
@@ -24,6 +33,7 @@
|
|
24
33
|
* Added support for reporters
|
25
34
|
* Added JUnit reporter
|
26
35
|
|
36
|
+
|
27
37
|
## 0.0.5
|
28
38
|
|
29
39
|
###### Bug Fixes
|
@@ -37,13 +47,9 @@
|
|
37
47
|
|
38
48
|
* Prettier `--simple` output
|
39
49
|
[Preview](https://travis-ci.org/allending/Kiwi/builds/15190533)
|
40
|
-
|
41
50
|
* Removed Paint dependency
|
42
|
-
|
43
51
|
* Better test failure formatting (added indentation, grouped by suite)
|
44
|
-
|
45
52
|
* Added example of running tests continuously
|
46
|
-
|
47
53
|
* Support for not using Unicode (`--no-utf`)
|
48
54
|
|
49
55
|
###### Bug Fixes
|
@@ -53,12 +59,13 @@
|
|
53
59
|
|
54
60
|
## 0.0.3
|
55
61
|
|
56
|
-
|
62
|
+
* add Ruby 1.8 support
|
57
63
|
|
58
64
|
## 0.0.2
|
59
65
|
|
60
|
-
|
66
|
+
* add Ruby 1.9 support
|
61
67
|
|
62
68
|
## 0.0.1
|
63
69
|
|
64
|
-
|
70
|
+
* initial version
|
71
|
+
|
data/bin/xcpretty
CHANGED
@@ -62,12 +62,11 @@ OptionParser.new do |opts|
|
|
62
62
|
end
|
63
63
|
opts.on_tail('-h', '--help', 'Show this message') { puts opts; exit }
|
64
64
|
opts.on_tail("-v", "--version", "Show version") { puts XCPretty::VERSION; exit }
|
65
|
+
opts.parse!
|
65
66
|
|
66
67
|
if STDIN.tty?
|
67
68
|
$stderr.puts opts.help
|
68
69
|
exit 1
|
69
|
-
else
|
70
|
-
opts.parse!
|
71
70
|
end
|
72
71
|
end
|
73
72
|
|
@@ -122,10 +122,16 @@ Feature: Showing build output in simple format
|
|
122
122
|
When I pipe to xcpretty with "--simple --color"
|
123
123
|
Then I should see a red error message
|
124
124
|
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
125
|
+
Scenario: Compilation fails because of syntax errors
|
126
|
+
Given there was a syntax error
|
127
|
+
When I pipe to xcpretty with "--simple --color"
|
128
|
+
Then I should see a red compilation error
|
129
|
+
And I should see a failed line
|
130
|
+
And I should see a cyan cursor
|
131
|
+
|
132
|
+
Scenario: Linker fails with undefined symbols
|
133
|
+
Given the linker has failed with undefined symbols
|
134
|
+
When I pipe to xcpretty with "--simple --color"
|
135
|
+
Then I should see the undefined symbold message
|
136
|
+
And I should see the symbol and reference that caused failure
|
131
137
|
|
@@ -65,9 +65,11 @@ Given(/^podfile.lock wasn't in sync$/) do
|
|
65
65
|
end
|
66
66
|
|
67
67
|
Given(/^there was a syntax error$/) do
|
68
|
-
SAMPLE_COMPILE_ERROR
|
69
|
-
|
70
|
-
|
68
|
+
add_run_input SAMPLE_COMPILE_ERROR
|
69
|
+
end
|
70
|
+
|
71
|
+
Given(/^the linker has failed with undefined symbols$/) do
|
72
|
+
add_run_input SAMPLE_UNDEFINED_SYMBOLS
|
71
73
|
end
|
72
74
|
|
73
75
|
When(/^I pipe to xcpretty with "(.*?)"$/) do |flags|
|
@@ -181,7 +183,7 @@ Then(/^I should not see the name of the test group$/) do
|
|
181
183
|
end
|
182
184
|
|
183
185
|
Then(/^I should see a red error message$/) do
|
184
|
-
run_output.should include(red("⌦ "
|
186
|
+
run_output.should include(red("⌦ " + SAMPLE_PODS_ERROR.gsub('error: ', '')))
|
185
187
|
end
|
186
188
|
|
187
189
|
Then(/^I should see a red compilation error$/) do
|
@@ -196,3 +198,12 @@ Then(/^I should see a cyan cursor$/) do
|
|
196
198
|
run_output.should include(cyan(" ^"))
|
197
199
|
end
|
198
200
|
|
201
|
+
Then(/^I should see the undefined symbold message$/) do
|
202
|
+
run_output.should include(red("⌦ Undefined symbols for architecture x86_64"))
|
203
|
+
end
|
204
|
+
|
205
|
+
Then(/^I should see the symbol and reference that caused failure$/) do
|
206
|
+
run_output.should include("_OBJC_CLASS_$_CABasicAnimation")
|
207
|
+
run_output.should include("objc-class-ref in ATZRadialProgressControl.o")
|
208
|
+
end
|
209
|
+
|
@@ -2,6 +2,23 @@ Given(/^the build has failed$/) do
|
|
2
2
|
add_run_input "/Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSArrayCategoriesTests.m:53:13: error: use of undeclared identifier 'something'"
|
3
3
|
end
|
4
4
|
|
5
|
+
When(/^I run xcpretty$/) do
|
6
|
+
@output = `bin/xcpretty 2>&1`
|
7
|
+
end
|
8
|
+
|
9
|
+
When(/^I run xcpretty with (.*)$/) do |flags|
|
10
|
+
@output = `bin/xcpretty #{flags}`
|
11
|
+
end
|
12
|
+
|
13
|
+
Then(/^I should see the help banner$/) do
|
14
|
+
run_output.should include("Usage: xcodebuild [options] | xcpretty")
|
15
|
+
end
|
16
|
+
|
17
|
+
Then(/^I should see the xcpretty version$/) do
|
18
|
+
run_output.should include(XCPretty::VERSION)
|
19
|
+
end
|
20
|
+
|
5
21
|
Then(/^the exit status code should be (\d)$/) do |numbah|
|
6
22
|
$?.exitstatus.should == numbah.to_i
|
7
23
|
end
|
24
|
+
|
data/features/support/env.rb
CHANGED
data/features/xcpretty.feature
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Feature:
|
1
|
+
Feature: CLI behavior
|
2
2
|
|
3
3
|
Scenario: Xcode tests have failed
|
4
4
|
Given I have a failing test in my suite
|
@@ -10,3 +10,11 @@ Feature: Status codes
|
|
10
10
|
When I pipe to xcpretty
|
11
11
|
Then the exit status code should be 1
|
12
12
|
|
13
|
+
Scenario: Starting xcpretty without any flags
|
14
|
+
When I run xcpretty
|
15
|
+
Then I should see the help banner
|
16
|
+
|
17
|
+
Scenario: Starting xcpretty with version
|
18
|
+
When I run xcpretty with -v
|
19
|
+
Then I should see the xcpretty version
|
20
|
+
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# encoding: utf-8
|
1
2
|
require 'xcpretty/ansi'
|
2
3
|
require 'xcpretty/parser'
|
3
4
|
|
@@ -6,34 +7,39 @@ module XCPretty
|
|
6
7
|
# Making a new formatter is easy.
|
7
8
|
# Just make a subclass of Formatter, and override any of these methods.
|
8
9
|
module FormatMethods
|
9
|
-
|
10
|
-
|
11
|
-
def
|
12
|
-
def
|
13
|
-
def
|
14
|
-
def
|
15
|
-
def
|
16
|
-
def
|
17
|
-
def
|
18
|
-
def format_compile_xib(file_name, file_path);
|
19
|
-
def format_copy_strings_file(file_name);
|
20
|
-
def format_cpresource(file);
|
21
|
-
def
|
22
|
-
def
|
23
|
-
def
|
24
|
-
def
|
25
|
-
def
|
26
|
-
def
|
27
|
-
def
|
28
|
-
def
|
29
|
-
def
|
30
|
-
def
|
31
|
-
def
|
32
|
-
def
|
33
|
-
def
|
34
|
-
def
|
35
|
-
def
|
36
|
-
|
10
|
+
EMPTY = ''.freeze
|
11
|
+
|
12
|
+
def format_analyze(file_name, file_path); EMPTY; end
|
13
|
+
def format_build_target(target, project, configuration); EMPTY; end
|
14
|
+
def format_check_dependencies; EMPTY; end
|
15
|
+
def format_clean(project, target, configuration); EMPTY; end
|
16
|
+
def format_clean_target(target, project, configuration); EMPTY; end
|
17
|
+
def format_clean_remove; EMPTY; end
|
18
|
+
def format_compile(file_name, file_path); EMPTY; end
|
19
|
+
def format_compile_xib(file_name, file_path); EMPTY; end
|
20
|
+
def format_copy_strings_file(file_name); EMPTY; end
|
21
|
+
def format_cpresource(file); EMPTY; end
|
22
|
+
def format_generate_dsym(dsym); EMPTY; end
|
23
|
+
def format_linking(file, build_variant, arch); EMPTY; end
|
24
|
+
def format_libtool(library); EMPTY; end
|
25
|
+
def format_passing_test(suite, test, time); EMPTY; end
|
26
|
+
def format_failing_test(suite, test, time, file_path); EMPTY; end
|
27
|
+
def format_process_pch(file); EMPTY; end
|
28
|
+
def format_phase_script_execution(script_name); EMPTY; end
|
29
|
+
def format_process_info_plist(file_name, file_path); EMPTY; end
|
30
|
+
def format_codesign(file); EMPTY; end
|
31
|
+
def format_preprocess(file); EMPTY; end
|
32
|
+
def format_pbxcp(file); EMPTY; end
|
33
|
+
def format_test_run_started(name); EMPTY; end
|
34
|
+
def format_test_run_finished(name, time); EMPTY; end
|
35
|
+
def format_test_suite_started(name); EMPTY; end
|
36
|
+
def format_test_summary(message, failures_per_suite); EMPTY; end
|
37
|
+
|
38
|
+
# COMPILER / LINKER ERRORS
|
39
|
+
def format_compile_error(file_name, file_path, reason,
|
40
|
+
line, cursor); EMPTY; end
|
41
|
+
def format_error(message); EMPTY; end
|
42
|
+
def format_linker_failure(message, symbol, reference); EMPTY; end
|
37
43
|
end
|
38
44
|
|
39
45
|
class Formatter
|
@@ -72,6 +78,21 @@ module XCPretty
|
|
72
78
|
"\n\n#{text}"
|
73
79
|
end
|
74
80
|
|
81
|
+
ERROR = "⌦"
|
82
|
+
ASCII_ERROR = "[!]"
|
83
|
+
|
84
|
+
def format_error(message)
|
85
|
+
red((use_unicode? ? ERROR : ASCII_ERROR) + " " + message)
|
86
|
+
end
|
87
|
+
|
88
|
+
def format_compile_error(file, file_path, reason, line, cursor)
|
89
|
+
"\n#{file_path}: #{red(reason)}\n\n#{line}\n#{cyan(cursor)}\n\n"
|
90
|
+
end
|
91
|
+
|
92
|
+
def format_linker_failure(message, symbol, reference)
|
93
|
+
"\n#{red("⌦ " + message)}\n> Symbol: #{symbol}\n> Referenced from: #{reference}\n\n"
|
94
|
+
end
|
95
|
+
|
75
96
|
|
76
97
|
private
|
77
98
|
|
@@ -7,11 +7,9 @@ module XCPretty
|
|
7
7
|
|
8
8
|
PASS = "✓"
|
9
9
|
FAIL = "✗"
|
10
|
-
ERROR = "⌦ "
|
11
10
|
|
12
11
|
ASCII_PASS = "."
|
13
12
|
ASCII_FAIL = "x"
|
14
|
-
ASCII_ERROR = "[!]"
|
15
13
|
COMPLETION = "▸"
|
16
14
|
ASCII_COMPLETION = ">"
|
17
15
|
|
@@ -43,14 +41,6 @@ module XCPretty
|
|
43
41
|
format("Copying", resource)
|
44
42
|
end
|
45
43
|
|
46
|
-
def format_error(message)
|
47
|
-
status_symbol(:error) + " " + red(message)
|
48
|
-
end
|
49
|
-
|
50
|
-
def format_compile_error(file, file_path, reason, line, cursor)
|
51
|
-
"\n#{file_path}: #{red(reason)}\n\n#{line}\n#{cyan(cursor)}\n\n"
|
52
|
-
end
|
53
|
-
|
54
44
|
def format_generate_dsym(dsym)
|
55
45
|
format("Generating '#{dsym}'")
|
56
46
|
end
|
data/lib/xcpretty/parser.rb
CHANGED
@@ -42,7 +42,7 @@ module XCPretty
|
|
42
42
|
# $1 = file_path
|
43
43
|
# $2 = file_name
|
44
44
|
# $3 = reason
|
45
|
-
COMPILE_ERROR_MATCHER = /^(.+\/(.*\.[h,m,c]).*)
|
45
|
+
COMPILE_ERROR_MATCHER = /^(.+\/(.*\.[h,m,c]).*):(?:\sfatal)?\serror:\s(.*)$/
|
46
46
|
|
47
47
|
# @regex Captured groups
|
48
48
|
# $1 file_path
|
@@ -80,6 +80,10 @@ module XCPretty
|
|
80
80
|
# $1 = library
|
81
81
|
LIBTOOL_MATCHER = /^Libtool.*\/(.*\.a)/
|
82
82
|
|
83
|
+
# @regex Captured groups
|
84
|
+
# $1 reason
|
85
|
+
LINKER_FAILURE_MATCHER = /^(Undefined symbols for architecture .*):$/
|
86
|
+
|
83
87
|
# @regex Captured groups
|
84
88
|
# $1 = target
|
85
89
|
# $2 = build_variants (normal, profile, debug)
|
@@ -114,6 +118,11 @@ module XCPretty
|
|
114
118
|
# @regex Captured groups
|
115
119
|
# $1 = file
|
116
120
|
PROCESS_INFO_PLIST_MATCHER = /^ProcessInfoPlistFile\s.*\.plist\s(.*\/+(.*\.plist))/
|
121
|
+
|
122
|
+
# @regex Captured groups
|
123
|
+
# $1 = reference
|
124
|
+
SYMBOL_REFERENCED_FROM_MATCHER = /\s*"(.*)", referenced from:$/
|
125
|
+
|
117
126
|
# @regex Captured groups
|
118
127
|
# $1 = suite
|
119
128
|
# $2 = time
|
@@ -141,8 +150,10 @@ module XCPretty
|
|
141
150
|
def parse(text)
|
142
151
|
update_test_state(text)
|
143
152
|
update_error_state(text)
|
153
|
+
update_linker_failure_state(text)
|
144
154
|
|
145
155
|
return format_error if should_format_error?
|
156
|
+
return format_linker_failure if should_format_linker_failure?
|
146
157
|
|
147
158
|
case text
|
148
159
|
when ANALYZE_MATCHER
|
@@ -227,8 +238,20 @@ module XCPretty
|
|
227
238
|
elsif text =~ CURSOR_MATCHER
|
228
239
|
@formatting_error = false
|
229
240
|
current_error[:cursor] = $1.chomp
|
230
|
-
|
231
|
-
current_error[:line] = text.chomp
|
241
|
+
elsif @formatting_error
|
242
|
+
current_error[:line] = text.chomp
|
243
|
+
end
|
244
|
+
end
|
245
|
+
|
246
|
+
def update_linker_failure_state(text)
|
247
|
+
if text =~ LINKER_FAILURE_MATCHER
|
248
|
+
@formatting_linker_error = true
|
249
|
+
current_linker_failure[:message] = $1
|
250
|
+
elsif text =~ SYMBOL_REFERENCED_FROM_MATCHER
|
251
|
+
current_linker_failure[:symbol] = $1
|
252
|
+
elsif @formatting_linker_error
|
253
|
+
current_linker_failure[:reference] = text.strip
|
254
|
+
@formatting_linker_error = false
|
232
255
|
end
|
233
256
|
end
|
234
257
|
|
@@ -237,10 +260,20 @@ module XCPretty
|
|
237
260
|
current_error[:reason] && current_error[:cursor] && current_error[:line]
|
238
261
|
end
|
239
262
|
|
263
|
+
def should_format_linker_failure?
|
264
|
+
current_linker_failure[:message] &&
|
265
|
+
current_linker_failure[:symbol] &&
|
266
|
+
current_linker_failure[:reference]
|
267
|
+
end
|
268
|
+
|
240
269
|
def current_error
|
241
270
|
@current_error ||= {}
|
242
271
|
end
|
243
272
|
|
273
|
+
def current_linker_failure
|
274
|
+
@linker_failure ||= {}
|
275
|
+
end
|
276
|
+
|
244
277
|
def format_error
|
245
278
|
error = current_error.dup
|
246
279
|
@current_error = {}
|
@@ -251,6 +284,14 @@ module XCPretty
|
|
251
284
|
error[:cursor])
|
252
285
|
end
|
253
286
|
|
287
|
+
def format_linker_failure
|
288
|
+
failure = current_linker_failure.dup
|
289
|
+
@linker_failure = {}
|
290
|
+
formatter.format_linker_failure(failure[:message],
|
291
|
+
failure[:symbol],
|
292
|
+
failure[:reference])
|
293
|
+
end
|
294
|
+
|
254
295
|
def store_failure(file, test_suite, test_case, reason)
|
255
296
|
failures_per_suite[test_suite] ||= []
|
256
297
|
failures_per_suite[test_suite] << {
|
data/lib/xcpretty/version.rb
CHANGED
data/spec/fixtures/constants.rb
CHANGED
@@ -466,9 +466,25 @@ SAMPLE_COMPILE_ERROR = %Q(
|
|
466
466
|
[[thread.lastMessage should] equal:thread.];
|
467
467
|
^
|
468
468
|
)
|
469
|
+
|
470
|
+
SAMPLE_FATAL_COMPILE_ERROR = %Q(
|
471
|
+
In file included from /Users/musalj/code/OSS/SampleApp/Pods/SuperCoolPod/SuperAwesomeClass.m:12:
|
472
|
+
In file included from /Users/musalj/code/OSS/SampleApp/Pods/../LessCoolPod/LessCoolClass.h:9:
|
473
|
+
In file included from /Users/musalj/code/OSS/SampleApp/Pods/../LessCoolPod/EvenLessCoolClass.h:10:
|
474
|
+
/Users/musalj/code/OSS/SampleApp/Pods/Headers/LessCoolPod/SomeRandomClass.h:31:9: fatal error: 'SomeRandomHeader.h' file not found
|
475
|
+
#import "SomeRandomHeader.h"
|
476
|
+
^
|
477
|
+
)
|
469
478
|
SAMPLE_COMPILE_ERROR_WITH_TILDES = %Q(
|
470
479
|
/Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSSetTests.m:93:16: error: no visible @interface for 'NSArray' declares the selector 'shoulds'
|
471
480
|
}] shoulds] equal:@[ @"F458 Italia", @"Testarossa" ]];
|
472
481
|
~~ ^~~~~~~
|
473
482
|
)
|
483
|
+
SAMPLE_UNDEFINED_SYMBOLS = %Q(
|
484
|
+
Undefined symbols for architecture x86_64:
|
485
|
+
"_OBJC_CLASS_$_CABasicAnimation", referenced from:
|
486
|
+
objc-class-ref in ATZRadialProgressControl.o
|
487
|
+
ld: symbol(s) not found for architecture x86_64
|
488
|
+
clang: error: linker command failed with exit code 1 (use -v to see invocation)
|
489
|
+
)
|
474
490
|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
1
3
|
require 'xcpretty'
|
2
4
|
|
3
5
|
module XCPretty
|
@@ -20,6 +22,36 @@ module XCPretty
|
|
20
22
|
@formatter.optional_newline.should == "\n"
|
21
23
|
end
|
22
24
|
|
25
|
+
it "formats cocoapods errors" do
|
26
|
+
@formatter.format_error("The sandbox is not in sync...").should ==
|
27
|
+
"#{@formatter.red("⌦ The sandbox is not in sync...")}"
|
28
|
+
end
|
29
|
+
|
30
|
+
it "formats compiling errors" do
|
31
|
+
@formatter.format_compile_error("file", "path/to/file", "expected valid syntax",
|
32
|
+
"[a should",
|
33
|
+
" ^").should ==
|
34
|
+
%Q(
|
35
|
+
path/to/file: #{@formatter.red("expected valid syntax")}
|
36
|
+
|
37
|
+
[a should
|
38
|
+
#{@formatter.cyan(" ^")}
|
39
|
+
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
|
44
|
+
it "formats linker failures by default" do
|
45
|
+
@formatter.format_linker_failure("Undefined symbols for architecture x86_64",
|
46
|
+
'_OBJC_CLASS_$_CABasicAnimation',
|
47
|
+
'objc-class-ref in ATZRadialProgressControl.o').should == %Q(
|
48
|
+
#{@formatter.red("⌦ Undefined symbols for architecture x86_64")}
|
49
|
+
> Symbol: _OBJC_CLASS_$_CABasicAnimation
|
50
|
+
> Referenced from: objc-class-ref in ATZRadialProgressControl.o
|
51
|
+
|
52
|
+
)
|
53
|
+
end
|
54
|
+
|
23
55
|
if RUBY_VERSION > '1.8.7'
|
24
56
|
it "formats failures per suite" do
|
25
57
|
failures = {
|
@@ -25,24 +25,6 @@ module XCPretty
|
|
25
25
|
"> Cleaning Pods/Pods-ObjectiveSugar [Debug]"
|
26
26
|
end
|
27
27
|
|
28
|
-
it "formats cocoapods errors" do
|
29
|
-
@formatter.format_error("The sandbox is not in sync...").should ==
|
30
|
-
"[!] The sandbox is not in sync..."
|
31
|
-
end
|
32
|
-
|
33
|
-
it "formats compiling errors" do
|
34
|
-
@formatter.format_compile_error("file", "path/to/file", "expected valid syntax",
|
35
|
-
"[a should",
|
36
|
-
" ^").should ==
|
37
|
-
%Q(
|
38
|
-
path/to/file: expected valid syntax
|
39
|
-
|
40
|
-
[a should
|
41
|
-
^
|
42
|
-
|
43
|
-
)
|
44
|
-
end
|
45
|
-
|
46
28
|
it "formats compiling output" do
|
47
29
|
@formatter.format_compile("NSMutableArray+ObjectiveSugar.m", 'path/to/file').should ==
|
48
30
|
"> Compiling NSMutableArray+ObjectiveSugar.m"
|
@@ -46,6 +46,16 @@ module XCPretty
|
|
46
46
|
@parser.parse("Check dependencies")
|
47
47
|
end
|
48
48
|
|
49
|
+
it "parses code signing" do
|
50
|
+
@formatter.should receive(:format_codesign).with("build/Release/CocoaChip.app")
|
51
|
+
@parser.parse(SAMPLE_CODESIGN)
|
52
|
+
end
|
53
|
+
|
54
|
+
it "parses code signing a framework" do
|
55
|
+
@formatter.should receive(:format_codesign).with("build/Release/CocoaChipCore.framework")
|
56
|
+
@parser.parse(SAMPLE_CODESIGN_FRAMEWORK)
|
57
|
+
end
|
58
|
+
|
49
59
|
it "parses compiling categories" do
|
50
60
|
@formatter.should receive(:format_compile).with("NSMutableArray+ObjectiveSugar.m", "/Users/musalj/code/OSS/ObjectiveSugar/Classes/NSMutableArray+ObjectiveSugar.m")
|
51
61
|
@parser.parse(SAMPLE_COMPILE)
|
@@ -117,16 +127,6 @@ module XCPretty
|
|
117
127
|
@parser.parse(SAMPLE_PRECOMPILE)
|
118
128
|
end
|
119
129
|
|
120
|
-
it "parses code signing" do
|
121
|
-
@formatter.should receive(:format_codesign).with("build/Release/CocoaChip.app")
|
122
|
-
@parser.parse(SAMPLE_CODESIGN)
|
123
|
-
end
|
124
|
-
|
125
|
-
it "parses code signing a framework" do
|
126
|
-
@formatter.should receive(:format_codesign).with("build/Release/CocoaChipCore.framework")
|
127
|
-
@parser.parse(SAMPLE_CODESIGN_FRAMEWORK)
|
128
|
-
end
|
129
|
-
|
130
130
|
it "parses preprocessing" do
|
131
131
|
@formatter.should receive(:format_preprocess).with("CocoaChip/CocoaChip-Info.plist")
|
132
132
|
@parser.parse(SAMPLE_PREPROCESS)
|
@@ -137,6 +137,16 @@ module XCPretty
|
|
137
137
|
@parser.parse(SAMPLE_PBXCP)
|
138
138
|
end
|
139
139
|
|
140
|
+
it "parses undefined symbols" do
|
141
|
+
@formatter.should receive(:format_linker_failure).with("Undefined symbols for architecture x86_64",
|
142
|
+
'_OBJC_CLASS_$_CABasicAnimation',
|
143
|
+
'objc-class-ref in ATZRadialProgressControl.o')
|
144
|
+
|
145
|
+
SAMPLE_UNDEFINED_SYMBOLS.each_line do |line|
|
146
|
+
@parser.parse(line)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
|
140
150
|
it "parses test run finished" do
|
141
151
|
@formatter.should receive(:format_test_run_finished).with('ReactiveCocoaTests.octest(Tests)', '2013-12-10 07:03:03 +0000.')
|
142
152
|
@parser.parse(SAMPLE_OCUNIT_TEST_RUN_COMPLETION)
|
@@ -171,6 +181,23 @@ module XCPretty
|
|
171
181
|
end
|
172
182
|
end
|
173
183
|
|
184
|
+
it 'parses fatal compiling errors' do
|
185
|
+
@formatter.should receive(:format_compile_error).with(
|
186
|
+
'SomeRandomClass.h',
|
187
|
+
'/Users/musalj/code/OSS/SampleApp/Pods/Headers/LessCoolPod/SomeRandomClass.h:31:9',
|
188
|
+
"'SomeRandomHeader.h' file not found",
|
189
|
+
'#import "SomeRandomHeader.h"',
|
190
|
+
' ^'
|
191
|
+
# For now, it's probably not worth to provide the import stack
|
192
|
+
# It'd require more state, and not sure if it'd be any useful
|
193
|
+
#%Q(In file included from /Users/musalj/code/OSS/SampleApp/Pods/SuperCoolPod/SuperAwesomeClass.m:12:
|
194
|
+
#In file included from /Users/musalj/code/OSS/SampleApp/Pods/../LessCoolPod/LessCoolClass.h:9:
|
195
|
+
#In file included from /Users/musalj/code/OSS/SampleApp/Pods/../LessCoolPod/EvenLessCoolClass.h:10:)
|
196
|
+
)
|
197
|
+
SAMPLE_FATAL_COMPILE_ERROR.each_line do |line|
|
198
|
+
@parser.parse(line)
|
199
|
+
end
|
200
|
+
end
|
174
201
|
|
175
202
|
it "parses compiling errors with tildes" do
|
176
203
|
@formatter.should receive(:format_compile_error).with(
|
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.0.
|
4
|
+
version: 0.0.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: 2013-12-
|
12
|
+
date: 2013-12-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|