xcpretty 0.1.0 → 0.1.1

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: 9b2c23619219f7da6d12fbe9603ba2deece7157d
4
- data.tar.gz: de800a6d3e0ca7806915e708e7b1483a708c0140
3
+ metadata.gz: 15e5b2c06fdab978445beef93dcd79340a31e754
4
+ data.tar.gz: f86212f6533fab98da537943c3a4464685471d8b
5
5
  SHA512:
6
- metadata.gz: 1eac17f808e34f54236c1b003ea467e6575fdd8b16a5dddf8e3a2baa98ce8fa5ec57b0a0ef2af1236f226c8c49ab788ad4f0a0cd688d2ed1ecec70a902874f49
7
- data.tar.gz: 281d4d622def4747891d9e30878111e15ea8ca8d81de96fb3d69a0069c79f0242bfa3a6bd8623b195597696108ca424c894da59f135071e676b58974dd634bc2
6
+ metadata.gz: bfe0f34e95a6cea49c50c1249844abff6ddc447bae786bdfface21384bdad95c7ca48848045970545f95b8fae11fffccb7def9f612d43f827eab1209407dfd1b
7
+ data.tar.gz: d54e782c2bec5f3dd894348a28b235936189addfccee72fcb4cf054f016360816f3d14456dafc5553ff276b70dedbfddc6b638ccb4877308d8ceba59ea0e407e
data/CHANGELOG.md CHANGED
@@ -1,12 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1
4
+
5
+ ###### Enhancements
6
+
7
+ * Parse more fatal errors, and CodeSign errors that were printed to STDOUT |
8
+ [#51](https://github.com/mneorr/XCPretty/issues/51)
9
+
10
+
3
11
  ## 0.1.0
4
12
 
5
13
  ###### Enhancements
6
14
 
7
15
  * Color semi-slow tests in yellow, slow tests in red |
8
16
  [#46](https://github.com/mneorr/xcpretty/pull/46)
9
- * Add option to specify a custom location for report generation |
17
+ * Add option to specify a custom location for report generation |
10
18
  [#43](https://github.com/mneorr/XCPretty/pull/43)
11
19
 
12
20
 
data/README.md CHANGED
@@ -17,6 +17,14 @@ XCPretty is designed to be piped with `xcodebuild` and thus keeping 100% compati
17
17
  This means, when `xcodebuild` works, `xcpretty` works.
18
18
  It's even a bit faster than `xcodebuild` only, since it saves your terminal some prints.
19
19
 
20
+ __Important:__ exiting status code is still experimental, and could potentially
21
+ be removed from `xcpretty`. If you want to ensure the exit status code from
22
+ `xcodebuild`, add this to the end of pipe:
23
+
24
+ ```
25
+ xcodebuild ... | xcpretty -c; exit ${PIPESTATUS[0]}
26
+ ```
27
+
20
28
  ## Formats
21
29
 
22
30
  - `--color`, `-c` (you can add it to any format)
@@ -45,24 +53,7 @@ At this point, `xcodebuild` has got improved a lot, and it's ready to be used di
45
53
 
46
54
  There are many usages of this tool. Let me give you some ideas:
47
55
  - Xcode's test tools are close to useless. Failures in a sidebar, non-dettachable console,... You can use `xcpretty` to build your next Xcode test runner plugin
48
- - Run tests each time you hit save. Here's an example of doing so:
49
-
50
- ![continuous specs](http://i.imgur.com/9Oiht9y.gif)
51
-
52
- ``` ruby
53
- require 'listen'
54
- ignored = [/.git/, /xcuserdata/, /\.txt$/, /test-reports/]
55
- build_task = "xcodebuild -workspace Myapp.xcworkspace -scheme MyApp -sdk iphonesimulator -destination 'name=iPhone Retina (4-inch 64-bit)'"
56
-
57
- listener = Listen.to(Dir.pwd, ignore: ignored) do |modified, added, removed|
58
- system 'killall "iPhone Simulator"'
59
- system "#{build_task} test | xcpretty -tc"
60
- end
61
-
62
- listener.start
63
- sleep
64
- ```
65
- Just add this to your Rakefile, or in a ruby script. Make sure you `gem install listen`.
56
+ - Run tests each time you hit save. Use [xclisten](https://github.com/mneorr/xclisten) for that
66
57
  - Mine Bitcoins. You can't with this tool, but you'll be so productive that you can earn all the money and buy them!!!1!
67
58
 
68
59
  ## Roadmap
@@ -111,4 +111,3 @@ module XCPretty
111
111
 
112
112
  end
113
113
  end
114
-
@@ -33,6 +33,10 @@ module XCPretty
33
33
  # $1 = file
34
34
  CODESIGN_FRAMEWORK_MATCHER = /^CodeSign\s((?:\\ |[^ ])*.framework)\/Versions/
35
35
 
36
+ # @regex Captured groups
37
+ # $1 = whole error
38
+ CODESIGN_ERROR_MATCHER = /^(Code\s?Sign error:.*)$/
39
+
36
40
  # @regex Captured groups
37
41
  # $1 file_path
38
42
  # $2 file_name (e.g. KWNull.m)
@@ -72,6 +76,11 @@ module XCPretty
72
76
  # $4 = reason
73
77
  FAILING_TEST_MATCHER = /^(.+:\d+):\serror:\s[\+\-]\[(.*)\s(.*)\]\s:(?:\s'.*'\s\[FAILED\],)?\s(.*)/
74
78
 
79
+ # @regex Captured groups
80
+ # $1 = whole error.
81
+ # it varies a lot, not sure if it makes sense to catch everything separately
82
+ FATAL_ERROR_MATCHER = /^(fatal error:.*)$/
83
+
75
84
  # @regex Captured groups
76
85
  # $1 = dsym
77
86
  GENERATE_DSYM_MATCHER = /^GenerateDSYMFile \/.*\/(.*\.dSYM)/
@@ -166,7 +175,7 @@ module XCPretty
166
175
  update_error_state(text)
167
176
  update_linker_failure_state(text)
168
177
 
169
- return format_error if should_format_error?
178
+ return format_compile_error if should_format_error?
170
179
  return format_linker_failure if should_format_linker_failure?
171
180
 
172
181
  case text
@@ -182,6 +191,12 @@ module XCPretty
182
191
  formatter.format_copy_strings_file($1)
183
192
  when CHECK_DEPENDENCIES_MATCHER
184
193
  formatter.format_check_dependencies
194
+ when CODESIGN_FRAMEWORK_MATCHER
195
+ formatter.format_codesign($1)
196
+ when CODESIGN_MATCHER
197
+ formatter.format_codesign($1)
198
+ when CODESIGN_ERROR_MATCHER
199
+ formatter.format_error($1)
185
200
  when COMPILE_MATCHER
186
201
  formatter.format_compile($2, $1)
187
202
  when COMPILE_XIB_MATCHER
@@ -192,6 +207,8 @@ module XCPretty
192
207
  format_summary_if_needed(text)
193
208
  when FAILING_TEST_MATCHER
194
209
  formatter.format_failing_test($2, $3, $4, $1)
210
+ when FATAL_ERROR_MATCHER
211
+ formatter.format_error($1)
195
212
  when GENERATE_DSYM_MATCHER
196
213
  formatter.format_generate_dsym($1)
197
214
  when LIBTOOL_MATCHER
@@ -210,10 +227,6 @@ module XCPretty
210
227
  formatter.format_phase_script_execution(*unescaped($1))
211
228
  when PROCESS_PCH_MATCHER
212
229
  formatter.format_process_pch($1)
213
- when CODESIGN_FRAMEWORK_MATCHER
214
- formatter.format_codesign($1)
215
- when CODESIGN_MATCHER
216
- formatter.format_codesign($1)
217
230
  when PREPROCESS_MATCHER
218
231
  formatter.format_preprocess($1)
219
232
  when PBXCP_MATCHER
@@ -281,8 +294,8 @@ module XCPretty
281
294
  end
282
295
 
283
296
  def should_format_linker_failure?
284
- current_linker_failure[:message] &&
285
- current_linker_failure[:symbol] &&
297
+ current_linker_failure[:message] &&
298
+ current_linker_failure[:symbol] &&
286
299
  current_linker_failure[:reference]
287
300
  end
288
301
 
@@ -294,7 +307,7 @@ module XCPretty
294
307
  @linker_failure ||= {}
295
308
  end
296
309
 
297
- def format_error
310
+ def format_compile_error
298
311
  error = current_error.dup
299
312
  @current_error = {}
300
313
  formatter.format_compile_error(error[:file_name],
@@ -317,7 +330,7 @@ module XCPretty
317
330
  failures_per_suite[test_suite] << {
318
331
  :file => file,
319
332
  :reason => reason,
320
- :test_case => test_case,
333
+ :test_case => test_case
321
334
  }
322
335
  end
323
336
 
@@ -1,3 +1,3 @@
1
1
  module XCPretty
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -1,4 +1,5 @@
1
1
  # encoding: utf-8
2
+
2
3
  KIWI = 'kiwi'
3
4
  OCUNIT = 'ocunit'
4
5
  SAMPLE_OCUNIT_TEST_RUN_BEGINNING = "Test Suite '/Users/musalj/Library/Developer/Xcode/DerivedData/ReactiveCocoa-eznxkbqvgfsnrvetemqloysuwagb/Build/Products/Test/ReactiveCocoaTests.octest(Tests)' started at 2013-12-10 07:04:33 +0000"
@@ -472,6 +473,12 @@ PBXCp build/Release/CocoaChipCore.framework build/Release/CocoaChip.app/Contents
472
473
  builtin-copy -exclude .DS_Store -exclude CVS -exclude .svn -exclude .git -exclude .hg -strip-debug-symbols -strip-tool /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/strip -resolve-src-symlinks /Users/dustin/Source/CocoaChip/build/Release/CocoaChipCore.framework /Users/dustin/Source/CocoaChip/build/Release/CocoaChip.app/Contents/Frameworks
473
474
  warning: skipping copy phase strip, binary is code signed: /Users/dustin/Source/CocoaChip/build/Release/CocoaChipCore.framework/Versions/A/CocoaChipCore
474
475
  )
476
+
477
+
478
+ ################################################################################
479
+ # ERRORS
480
+ ################################################################################
481
+
475
482
  SAMPLE_PODS_ERROR = "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation."
476
483
 
477
484
  SAMPLE_COMPILE_ERROR = %Q(
@@ -480,6 +487,14 @@ SAMPLE_COMPILE_ERROR = %Q(
480
487
  ^
481
488
  )
482
489
 
490
+ SAMPLE_CODESIGN_ERROR = %Q(
491
+ Code Sign error: No code signing identites found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “CAT6HF57NJ” were found.
492
+ )
493
+
494
+ SAMPLE_CODESIGN_ERROR_NO_SPACES = %Q(
495
+ CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0'
496
+ )
497
+
483
498
  SAMPLE_FATAL_COMPILE_ERROR = %Q(
484
499
  In file included from /Users/musalj/code/OSS/SampleApp/Pods/SuperCoolPod/SuperAwesomeClass.m:12:
485
500
  In file included from /Users/musalj/code/OSS/SampleApp/Pods/../LessCoolPod/LessCoolClass.h:9:
@@ -488,11 +503,21 @@ In file included from /Users/musalj/code/OSS/SampleApp/Pods/../LessCoolPod/EvenL
488
503
  #import "SomeRandomHeader.h"
489
504
  ^
490
505
  )
506
+
507
+ SAMPLE_FATAL_COMPILE_PCH_ERROR = %Q(
508
+ fatal error: file '/path/to/myproject/Pods/Pods-environment.h' has been modified since the precompiled header '/Users/hiroshi/Library/Developer/Xcode/DerivedData/MyProject-gfmuvpipjscewkdnqacgumhfarrd/Build/Intermediates/PrecompiledHeaders/MyProject-Prefix-dwjpvcnrlaydzmegejmcvrtcfkpf/MyProject-Prefix.pch.pch' was built
509
+ )
510
+
511
+ SAMPLE_FATAL_HEADER_ERROR = %Q(
512
+ fatal error: malformed or corrupted AST file: 'could not find file '/Users/mpv/dev/project/Crashlytics.framework/Headers/Crashlytics.h' referenced by AST file' note: after modifying system headers, please delete the module cache at '/Users/mpv/Library/Developer/Xcode/DerivedData/ModuleCache/M5WJ0FYE7N06'
513
+ )
514
+
491
515
  SAMPLE_COMPILE_ERROR_WITH_TILDES = %Q(
492
516
  /Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSSetTests.m:93:16: error: no visible @interface for 'NSArray' declares the selector 'shoulds'
493
517
  }] shoulds] equal:@[ @"F458 Italia", @"Testarossa" ]];
494
518
  ~~ ^~~~~~~
495
519
  )
520
+
496
521
  SAMPLE_UNDEFINED_SYMBOLS = %Q(
497
522
  Undefined symbols for architecture x86_64:
498
523
  "_OBJC_CLASS_$_CABasicAnimation", referenced from:
@@ -500,4 +525,3 @@ Undefined symbols for architecture x86_64:
500
525
  ld: symbol(s) not found for architecture x86_64
501
526
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
502
527
  )
503
-
@@ -40,7 +40,6 @@ path/to/file: #{@formatter.red("expected valid syntax")}
40
40
  )
41
41
  end
42
42
 
43
-
44
43
  it "formats linker failures by default" do
45
44
  @formatter.format_linker_failure("Undefined symbols for architecture x86_64",
46
45
  '_OBJC_CLASS_$_CABasicAnimation',
@@ -217,6 +217,22 @@ module XCPretty
217
217
  end
218
218
  end
219
219
 
220
+ it 'parses fatal error: on the beginning of the line for corrupted AST files' do
221
+ @formatter.should receive(:format_error).with(
222
+ "fatal error: malformed or corrupted AST file: 'could not find file '/Users/mpv/dev/project/Crashlytics.framework/Headers/Crashlytics.h' referenced by AST file' note: after modifying system headers, please delete the module cache at '/Users/mpv/Library/Developer/Xcode/DerivedData/ModuleCache/M5WJ0FYE7N06'"
223
+ )
224
+ @parser.parse(SAMPLE_FATAL_HEADER_ERROR)
225
+ end
226
+
227
+ it 'parses fatal error: on the beginning of the line for cached PCH' do
228
+ @formatter.should receive(:format_error).with(
229
+ "fatal error: file '/path/to/myproject/Pods/Pods-environment.h' has been modified since the precompiled header '/Users/hiroshi/Library/Developer/Xcode/DerivedData/MyProject-gfmuvpipjscewkdnqacgumhfarrd/Build/Intermediates/PrecompiledHeaders/MyProject-Prefix-dwjpvcnrlaydzmegejmcvrtcfkpf/MyProject-Prefix.pch.pch' was built"
230
+ )
231
+ @parser.parse(SAMPLE_FATAL_COMPILE_PCH_ERROR)
232
+ end
233
+
234
+
235
+
220
236
  it "parses compiling errors with tildes" do
221
237
  @formatter.should receive(:format_compile_error).with(
222
238
  'NSSetTests.m',
@@ -229,6 +245,20 @@ module XCPretty
229
245
  end
230
246
  end
231
247
 
248
+ it "parses code sign error:" do
249
+ @formatter.should receive(:format_error).with(
250
+ 'Code Sign error: No code signing identites found: No valid signing identities (i.e. certificate and private key pair) matching the team ID “CAT6HF57NJ” were found.'
251
+ )
252
+ @parser.parse(SAMPLE_CODESIGN_ERROR)
253
+ end
254
+
255
+ it "parses CodeSign error: (no spaces)" do
256
+ @formatter.should receive(:format_error).with(
257
+ "CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 7.0'"
258
+ )
259
+ @parser.parse(SAMPLE_CODESIGN_ERROR_NO_SPACES)
260
+ end
261
+
232
262
  it "doesn't print the same error over and over" do
233
263
  SAMPLE_COMPILE_ERROR.each_line do |line|
234
264
  @parser.parse(line)
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.1.0
4
+ version: 0.1.1
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: 2014-01-03 00:00:00.000000000 Z
12
+ date: 2014-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -172,3 +172,4 @@ test_files:
172
172
  - spec/xcpretty/parser_spec.rb
173
173
  - spec/xcpretty/printer_spec.rb
174
174
  - spec/xcpretty/syntax_spec.rb
175
+ has_rdoc: