xcpretty 0.1.3 → 0.1.4

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: 46fc2cf7d4b723b36c5944ac2dae1e935f40987a
4
- data.tar.gz: e703e40ee1a621283885b2efae96b6e8406f4f84
3
+ metadata.gz: 3cdbe8277b55adfd4317be89f22241dc8d4c578c
4
+ data.tar.gz: 9bfea05a3753284b4e1db7e91943db93ee26ef21
5
5
  SHA512:
6
- metadata.gz: a8d7effa24f7900014019d49d58c9bfc4b2bb4e9e0eec3db61e1432a4ac5f3a92a036c15c81e2a9092a549d6b47ff6c6cee57d97f22704392ee74c687230adf1
7
- data.tar.gz: b39b856bbcc21faf8249df6014c6141861beb327d8236181169bc31ecebccb6eba02f8f4357652ba74f7a8ff28f1d4120a4d1a24e0b883c6443722ffa75bb98c
6
+ metadata.gz: a592232729d2a6b7401e7d647f372546f065a24ca3ff79c51d06a35aafac74203133628b19d665def319427bb1cc7755a0802d00c7b6c16ab882d8ff5c61f940
7
+ data.tar.gz: 39521953385cccd526e2d7b96dc0319cad393dce8803a2a14cf0b15d9e0bcf7a46cc84e3393681b101ab707c61f1d8a4a5248214e1442cdc8776cbe5af5ff22b
data/LICENSE.txt CHANGED
@@ -2,6 +2,45 @@ Copyright (c) 2013 Marin Usalj
2
2
 
3
3
  MIT License
4
4
 
5
+ ..,,,,,,,,,,,,. ......
6
+ .,,,,,,,,,,,,,,,,,,,,,,,,. ..,,,,,,,,,,
7
+ .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.
8
+ ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
9
+ .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;1111111
10
+ ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;i111111i,,,,,,,,11111111
11
+ ,,,,,,,,,,,.. .,,,,,,,,,,,,,,,,,,,.:11111111111iii11111111111
12
+ ,,,,,,,,:;i111111111111,,,,,,,,,,,,,,,:111. :1111111111111111111111
13
+ 11:,,,,,:111111111111111, i11,,,,,,,,,,,;111111 ;1111111111111111111
14
+ 1i,,,,i111111111111111: 11111;,,,,,,,,,11111111 11111111111111111
15
+ 11,:1111111111111111; .1111111,,,,,,,,,111111111. i11111111111111
16
+ 11111111111111111. i111111111,,,,,,,,11111111111. 11111111111
17
+ 111111111111111i .1111111111,,,,,,,,111111111111, .111111111
18
+ 11111111111111: 11111111111i,,,,,,,i11111111111.; 11111111
19
+ 1111111111111. :111111111111,,,,,,,:11111111111 ; 111111111
20
+ 111111111111 1111111111111,,,,,,,,11111111111 , ;1111111111
21
+ 11111111111 , :111111111111;,,,,,,,11111111111 ,11111111111
22
+ 1111111111 , i111111111111,,,,,,,1111111111; i111111111
23
+ 111111111 , 111111111111,,,,,,,1111111111. 11111111
24
+ 11111111111;.., 11111111111:,,,,,,i111111111 .111111
25
+ 111111111111i .11111111111,,,,,,;111111111 ;111111
26
+ 11111111111, .1111111111,,,,,,,111111111 1111111
27
+ 111111111i :111111111CCCCCCCt1111111: ,1111111
28
+ 11111111. ;1111111tCCCCCCCCt111111 11111111
29
+ 111111111. i111111CCCCCCCCCCt11111 11111111
30
+ 1111111111; 11111tCCCCCCCCCCCt111; i11111111
31
+ 111111111111 1111fCCCCCCCCCCCC111 111111111
32
+ 1111111111111 111LCCCCCCCCCCCCf11 ;111111111
33
+ 11111111111111: i1CCCCCCCCCCCCCCt. 1111111111
34
+ 111111111111111i ;CCCCCCCCCCCCCCL :1111111111
35
+ 11111111111111111 :CCCCCCCCCCCCC, 11111111111
36
+ 111111111111111111: .CCCCCCCCCCCC ,11111111111
37
+ 1111111111111111111i CCCCCCCCCC. 111111111111
38
+ 111111111111111111111 LCCCCCCCC :111111111111
39
+ 1111111111111111111111, 1CCCCCC. 1111111111111
40
+ 11111111111111111111111i ,CCCCL i1111111111111
41
+
42
+
43
+
5
44
  Permission is hereby granted, free of charge, to any person obtaining
6
45
  a copy of this software and associated documentation files (the
7
46
  "Software"), to deal in the Software without restriction, including
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
- # xcpretty
1
+ ![logo](http://i.imgur.com/i2fElxx.png)
2
2
 
3
3
  __`xcpretty` is a fast and flexible formatter for `xcodebuild`__.<br/>
4
4
  It does one thing, and it should do it well.
5
5
 
6
- [![Build Status](https://travis-ci.org/mneorr/xcpretty.png?branch=master)](https://travis-ci.org/mneorr/xcpretty)
7
- [![Code Climate](https://codeclimate.com/github/mneorr/XCPretty.png)](https://codeclimate.com/github/mneorr/XCPretty)
6
+ [![Build Status](https://travis-ci.org/supermarin/xcpretty.png?branch=master)](https://travis-ci.org/supermarin/xcpretty)
7
+ [![Code Climate](https://codeclimate.com/github/supermarin/xcpretty.png)](https://codeclimate.com/github/supermarin/xcpretty)
8
8
 
9
9
  ## Installation
10
10
  ``` bash
@@ -27,12 +27,16 @@ $ xcodebuild [flags] | xcpretty -c; exit ${PIPESTATUS[0]}
27
27
 
28
28
  ## Formats
29
29
 
30
- - `--color`, `-c` (you can add it to any format)
30
+ - `--color`, `-c` (you can add it to `--simple` or `--test` format)
31
+ - `--no-utf` (use only ASCII characters in output)
32
+
31
33
  - `--simple`, `-s` (default)
32
34
  ![xcpretty --simple](http://i.imgur.com/LdmozBS.gif)
33
35
 
34
36
  - `--test`, `-t` (RSpec style)
35
37
  ![xcpretty alpha](http://i.imgur.com/VeTQQub.gif)
38
+ - `--tap` ([Test Anything Protocol](http://testanything.org)-compatible output)
39
+ - `--knock`, `-k` (a [simplified version](https://github.com/chneukirchen/knock) of the Test Anything Protocol)
36
40
 
37
41
 
38
42
  ## Reporters
@@ -56,7 +60,7 @@ At this point `xcodebuild` has been improved significantly, and is ready to be u
56
60
 
57
61
  ## Benchmark
58
62
 
59
- A smaller project ([ObjectiveSugar](https://github.com/mneorr/objectivesugar)) with a fast suite
63
+ A smaller project ([ObjectiveSugar](https://github.com/supermarin/objectivesugar)) with a fast suite
60
64
 
61
65
  #### xcpretty
62
66
  ```
data/bin/xcpretty CHANGED
@@ -31,6 +31,12 @@ OptionParser.new do |opts|
31
31
  opts.on('-s', '--simple', 'Use simple output (default)') do
32
32
  printer_opts[:formatter] = XCPretty::Simple
33
33
  end
34
+ opts.on('-k', '--knock', 'Use knock output') do
35
+ printer_opts[:formatter] = XCPretty::Knock
36
+ end
37
+ opts.on('--tap', 'Use TAP output') do
38
+ printer_opts[:formatter] = XCPretty::TestAnything
39
+ end
34
40
  opts.on('-f', '--formatter PATH', 'Use formatter returned from evaluating the specified Ruby file') do |path|
35
41
  printer_opts[:formatter] = XCPretty.load_custom_formatter(path)
36
42
  end
@@ -0,0 +1,11 @@
1
+ Feature: Showing Knock-style test output
2
+
3
+ Scenario: Showing failed tests
4
+ Given I have a failing test in my suite
5
+ When I pipe to xcpretty with "--knock"
6
+ Then I should see text beginning with "not ok"
7
+
8
+ Scenario: Showing passing tests
9
+ Given I have a passing test in my suite
10
+ When I pipe to xcpretty with "--knock"
11
+ Then I should see text beginning with "ok"
@@ -20,7 +20,7 @@ Given(/^I have a file to shallow analyze$/) do
20
20
  end
21
21
 
22
22
  Given(/^I have a failing test in my suite$/) do
23
- add_run_input SAMPLE_SPECTA_FAILURE
23
+ add_run_input SAMPLE_OLD_SPECTA_FAILURE
24
24
  end
25
25
 
26
26
  Given(/^all of my tests will pass in my suite$/) do
@@ -92,6 +92,18 @@ Given(/^I have a file to touch$/) do
92
92
  add_run_input SAMPLE_TOUCH
93
93
  end
94
94
 
95
+ Then(/^I should see text beginning with "(.*?)"$/) do |text|
96
+ run_output.lines.to_a.detect {|line| line.start_with? text }.should_not be_nil
97
+ end
98
+
99
+ Then(/^I should see text containing "(.*?)" and beginning with "(.*?)"$/) do |inner, start|
100
+ run_output.lines.to_a.detect {|line| line.start_with?(start) && line.include?(inner)}.should_not be_nil
101
+ end
102
+
103
+ Then(/^I should (green|red) text beginning with "(.*?)"$/) do |color, text|
104
+ run_output.should start_with(send(color.to_sym, text))
105
+ end
106
+
95
107
  Then(/^I should see a successful tiff validation message$/) do
96
108
  run_output.should start_with("▸ Validating")
97
109
  end
@@ -248,5 +260,9 @@ Then(/^I should see the test time in yellow$/) do
248
260
  end
249
261
 
250
262
  Then(/^I should see the test time in red$/) do
251
- run_output.should include("#{red("0.101")}") end
263
+ run_output.should include("#{red("0.101")}")
264
+ end
252
265
 
266
+ Then(/^I should see text matching "(.*?)"$/) do |text|
267
+ run_output.lines.to_a.last.strip.should == text
268
+ end
@@ -0,0 +1,31 @@
1
+ Feature: Showing Test Anything Protocol-compatible test output
2
+
3
+ Scenario: Showing failed tests
4
+ Given I have a failing test in my suite
5
+ When I pipe to xcpretty with "--tap"
6
+ Then I should see text beginning with "not ok 1"
7
+
8
+ Scenario: Showing passing tests
9
+ Given I have a passing test in my suite
10
+ When I pipe to xcpretty with "--tap"
11
+ Then I should see text beginning with "ok 1"
12
+
13
+ Scenario: Showing pending tests
14
+ Given I have a pending test in my suite
15
+ When I pipe to xcpretty with "--tap"
16
+ Then I should see text containing " # TODO" and beginning with "not ok 1"
17
+
18
+ Scenario: Showing how many tests completed
19
+ Given I have a pending test in my suite
20
+ And I have a passing test in my suite
21
+ And I have a failing test in my suite
22
+ And the test suite has finished
23
+ When I pipe to xcpretty with "--tap"
24
+ Then I should see text matching "1..3"
25
+
26
+ Scenario: Showing a running test counter
27
+ Given I have a passing test in my suite
28
+ And I have a failing test in my suite
29
+ When I pipe to xcpretty with "--tap"
30
+ Then I should see text beginning with "ok 1"
31
+ And I should see text beginning with "not ok 2"
@@ -0,0 +1,34 @@
1
+ module XCPretty
2
+
3
+ class Knock < Formatter
4
+
5
+ FAIL = 'not ok'
6
+ PASS = 'ok'
7
+
8
+ def format_passing_test(suite, test_case, time)
9
+ "#{PASS} - #{test_case}"
10
+ end
11
+
12
+ def format_failing_test(test_suite, test_case, reason, file)
13
+ "#{FAIL} - #{test_case}: FAILED" +
14
+ format_failure_diagnostics(test_suite, test_case, reason, file)
15
+ end
16
+
17
+ def format_test_summary(executed_message, failures_per_suite)
18
+ ''
19
+ end
20
+
21
+ def format_failure_diagnostics(test_suite, test_case, reason, file)
22
+ format_diagnostics(reason) +
23
+ format_diagnostics(" #{file}: #{test_suite} - #{test_case}")
24
+ end
25
+
26
+ private
27
+
28
+ def format_diagnostics(text)
29
+ "\n# #{text}"
30
+ end
31
+
32
+ end
33
+
34
+ end
@@ -0,0 +1,39 @@
1
+ module XCPretty
2
+
3
+ class TestAnything < Knock
4
+
5
+ attr_reader :counter
6
+
7
+ def initialize unicode, color
8
+ super
9
+ @counter = 0
10
+ end
11
+
12
+ def format_passing_test(suite, test_case, time)
13
+ increment_counter
14
+ "#{PASS} #{counter} - #{test_case}"
15
+ end
16
+
17
+ def format_failing_test(test_suite, test_case, reason, file)
18
+ increment_counter
19
+ "#{FAIL} #{counter} - #{test_case}" +
20
+ format_failure_diagnostics(test_suite, test_case, reason, file)
21
+ end
22
+
23
+ def format_pending_test(test_suite, test_case)
24
+ increment_counter
25
+ "#{FAIL} #{counter} - #{test_case} # TODO Not written yet"
26
+ end
27
+
28
+ def format_test_summary(executed_message, failures_per_suite)
29
+ counter > 0 ? "1..#{counter}" : ''
30
+ end
31
+
32
+ private
33
+
34
+ def increment_counter
35
+ @counter += 1
36
+ end
37
+ end
38
+
39
+ end
@@ -44,7 +44,7 @@ module XCPretty
44
44
  # @regex Captured groups
45
45
  # $1 file_path
46
46
  # $2 file_name (e.g. KWNull.m)
47
- COMPILE_MATCHER = /^CompileC\s.*\s(.*\/(.*\.m))\s.*/
47
+ COMPILE_MATCHER = /^CompileC\s.*\s(.*\/(.*\.(?:m|mm|c|cc|cpp|cxx)))\s.*/
48
48
 
49
49
  # @regex Captured groups
50
50
  # $1 = file_path
@@ -71,14 +71,14 @@ module XCPretty
71
71
 
72
72
  # @regex Captured groups
73
73
  #
74
- EXECUTED_MATCHER = /^Executed/
74
+ EXECUTED_MATCHER = /^\s*Executed/
75
75
 
76
76
  # @regex Captured groups
77
77
  # $1 = file
78
78
  # $2 = test_suite
79
79
  # $3 = test_case
80
80
  # $4 = reason
81
- FAILING_TEST_MATCHER = /^(.+:\d+):\serror:\s[\+\-]\[(.*)\s(.*)\]\s:(?:\s'.*'\s\[FAILED\],)?\s(.*)/
81
+ FAILING_TEST_MATCHER = /^\s*(.+:\d+):\serror:\s[\+\-]\[(.*)\s(.*)\]\s:(?:\s'.*'\s\[FAILED\],)?\s(.*)/
82
82
 
83
83
  # @regex Captured groups
84
84
  # $1 = whole error.
@@ -111,7 +111,7 @@ module XCPretty
111
111
  # $1 = suite
112
112
  # $2 = test_case
113
113
  # $3 = time
114
- PASSING_TEST_MATCHER = /^Test Case\s'-\[(.*)\s(.*)\]'\spassed\s\((\d*\.\d{3})\sseconds\)/
114
+ PASSING_TEST_MATCHER = /^\s*Test Case\s'-\[(.*)\s(.*)\]'\spassed\s\((\d*\.\d{3})\sseconds\)/
115
115
 
116
116
  # @regex Captured groups
117
117
  # $1 = suite
@@ -148,16 +148,16 @@ module XCPretty
148
148
  # @regex Captured groups
149
149
  # $1 = suite
150
150
  # $2 = time
151
- TESTS_RUN_COMPLETION_MATCHER = /Test Suite '(?:.*\/)?(.*[ox]ctest.*)' finished at (.*)/
151
+ TESTS_RUN_COMPLETION_MATCHER = /^\s*Test Suite '(?:.*\/)?(.*[ox]ctest.*)' finished at (.*)/
152
152
 
153
153
  # @regex Captured groups
154
154
  # $1 = suite
155
155
  # $2 = time
156
- TESTS_RUN_START_MATCHER = /Test Suite '(?:.*\/)?(.*[ox]ctest.*)' started at(.*)/
156
+ TESTS_RUN_START_MATCHER = /^\s*Test Suite '(?:.*\/)?(.*[ox]ctest.*)' started at(.*)/
157
157
 
158
158
  # @regex Captured groups
159
159
  # $1 test suite name
160
- TEST_SUITE_START_MATCHER = /Test Suite '(.*)' started at/
160
+ TEST_SUITE_START_MATCHER = /^\s*Test Suite '(.*)' started at/
161
161
 
162
162
  # @regex Captured groups
163
163
  # $1 file_name
@@ -1,3 +1,3 @@
1
1
  module XCPretty
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
data/lib/xcpretty.rb CHANGED
@@ -4,6 +4,8 @@ require "xcpretty/syntax"
4
4
  require "xcpretty/formatters/formatter"
5
5
  require "xcpretty/formatters/simple"
6
6
  require "xcpretty/formatters/rspec"
7
+ require "xcpretty/formatters/knock"
8
+ require "xcpretty/formatters/tap"
7
9
  require "xcpretty/reporters/junit"
8
10
  require "xcpretty/reporters/html"
9
11
 
@@ -4,16 +4,20 @@ KIWI = 'kiwi'
4
4
  OCUNIT = 'ocunit'
5
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"
6
6
  SAMPLE_KIWI_TEST_RUN_BEGINNING = "Test Suite 'ObjectiveRecordTests.xctest' started at 2013-12-10 06:15:39 +0000"
7
+ SAMPLE_SPECTA_TEST_RUN_BEGINNING = " Test Suite 'KIFTests.xctest' started at 2014-02-28 15:43:42 +0000"
7
8
  SAMPLE_OCUNIT_TEST_RUN_COMPLETION = "Test Suite '/Users/musalj/Library/Developer/Xcode/DerivedData/ReactiveCocoa-eznxkbqvgfsnrvetemqloysuwagb/Build/Products/Test/ReactiveCocoaTests.octest(Tests)' finished at 2013-12-10 07:03:03 +0000."
8
9
  SAMPLE_KIWI_TEST_RUN_COMPLETION = "Test Suite 'ObjectiveRecordTests.xctest' finished at 2013-12-10 06:15:42 +0000."
10
+ SAMPLE_SPECTA_TEST_RUN_COMPLETION = " Test Suite 'KIFTests.xctest' finished at 2014-02-28 15:44:32 +0000."
9
11
 
10
12
  SAMPLE_OCUNIT_SUITE_BEGINNING = "Test Suite 'RACKVOWrapperSpec' started at 2013-12-10 21:06:10 +0000"
13
+ SAMPLE_SPECTA_SUITE_BEGINNING = " Test Suite 'All tests' started at 2014-02-28 19:07:41 +0000"
11
14
  SAMPLE_KIWI_SUITE_COMPLETION = "Test Suite 'All tests' finished at 2013-12-08 04:26:49 +0000."
12
15
  SAMPLE_OCUNIT_SUITE_COMPLETION = "Test Suite '/Users/musalj/Library/Developer/Xcode/DerivedData/ReactiveCocoa-eznxkbqvgfsnrvetemqloysuwagb/Build/Products/Test/ReactiveCocoaTests.octest(Tests)' finished at 2013-12-08 22:09:37 +0000."
13
16
  SAMPLE_XCTEST_SUITE_COMPLETION = "Test Suite 'ObjectiveSugarTests.xctest' finished at 2013-12-09 04:42:13 +0000."
14
17
 
15
18
  SAMPLE_KIWI_FAILURE = "/Users/musalj/code/OSS/ObjectiveSugar/Example/ObjectiveSugarTests/NSNumberTests.m:49: error: -[NumberAdditions Iterators_TimesIteratesTheExactNumberOfTimes] : 'Iterators, times: iterates the exact number of times' [FAILED], expected subject to equal 4, got 5"
16
- SAMPLE_SPECTA_FAILURE = "/Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458: error: -[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES] : expected: 1, got: 0"
19
+ SAMPLE_OLD_SPECTA_FAILURE = "/Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458: error: -[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES] : expected: 1, got: 0"
20
+ SAMPLE_SPECTA_FAILURE = " Test Case '-[SKWelcomeViewControllerSpecSpec SKWelcomeViewController_When_a_user_opens_the_app_from_a_clean_installation_displays_the_welcome_screen]' started. \n/Users/vickeryj/Code/ipad-register/KIFTests/Specs/SKWelcomeViewControllerSpec.m:11: error: -[SKWelcomeViewControllerSpecSpec SKWelcomeViewController_When_a_user_opens_the_app_from_a_clean_installation_displays_the_welcome_screen] : The step timed out after 2.00 seconds: Failed to find accessibility element with the label \"The asimplest way to make smarter business decisions\""
17
21
 
18
22
  SAMPLE_BUILD = "=== BUILD TARGET The Spacer OF PROJECT Pods WITH THE DEFAULT CONFIGURATION Debug ==="
19
23
  SAMPLE_CLEAN = "=== CLEAN TARGET Pods-ObjectiveSugar OF PROJECT Pods WITH CONFIGURATION Debug ==="
@@ -23,7 +27,9 @@ Clean.Remove clean /Users/musalj/Library/Developer/Xcode/DerivedData/ObjectiveSu
23
27
  builtin-rm -rf /Users/musalj/Library/Developer/Xcode/DerivedData/ObjectiveSugar-ayzdhqmmwtqgysdpznmovjlupqjy/Build/Intermediates/ObjectiveSugar.build/Debug-iphonesimulator/ObjectiveSugarTests.build
24
28
  )
25
29
  SAMPLE_EXECUTED_TESTS = "Executed 4 tests, with 0 failures (0 unexpected) in 0.003 (0.004) seconds"
30
+ SAMPLE_SPECTA_EXECUTED_TESTS = " Executed 4 tests, with 0 failures (0 unexpected) in 10.192 (10.193) seconds"
26
31
  SAMPLE_OCUNIT_TEST = "Test Case '-[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES]' passed (0.001 seconds)."
32
+ SAMPLE_SPECTA_TEST = " Test Case '-[SKWelcomeActivationViewControllerSpecSpec SKWelcomeActivationViewController_When_a_user_enters_their_details_lets_them_enter_a_valid_manager_code]' passed (0.725 seconds)."
27
33
  SAMPLE_SLOWISH_TEST = "Test Case '-[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES]' passed (0.026 seconds)."
28
34
  SAMPLE_SLOW_TEST = "Test Case '-[RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES]' passed (0.101 seconds)."
29
35
  SAMPLE_KIWI_TEST = "Test Case '-[MappingsTests Mappings_SupportsCreatingAParentObjectUsingJustIDFromTheServer]' passed (0.004 seconds)."
@@ -68,6 +68,18 @@ module XCPretty
68
68
  @parser.parse(SAMPLE_ANOTHER_COMPILE)
69
69
  end
70
70
 
71
+ it "parses compiling Objective-C++ classes" do
72
+ @formatter.should receive(:format_compile).with("KWNull.mm", "Classes/Core/KWNull.mm")
73
+ @parser.parse(SAMPLE_ANOTHER_COMPILE.sub('.m', '.mm'))
74
+ end
75
+
76
+ it "parses compiling C and C++ files" do
77
+ for file_extension in ['.c', '.cc', '.cpp', '.cxx'] do
78
+ @formatter.should receive(:format_compile).with("KWNull" + file_extension, "Classes/Core/KWNull" + file_extension)
79
+ @parser.parse(SAMPLE_ANOTHER_COMPILE.sub('.m', file_extension))
80
+ end
81
+ end
82
+
71
83
  it "parses compiling XIBs" do
72
84
  @formatter.should receive(:format_compile_xib).with("MainMenu.xib", "CocoaChip/en.lproj/MainMenu.xib")
73
85
  @parser.parse(SAMPLE_COMPILE_XIB)
@@ -103,22 +115,36 @@ module XCPretty
103
115
  @parser.parse(SAMPLE_LIBTOOL)
104
116
  end
105
117
 
106
- it "parses failing tests" do
118
+ it "parses specta failing tests" do
119
+ @formatter.should receive(:format_failing_test).with("SKWelcomeViewControllerSpecSpec",
120
+ "SKWelcomeViewController_When_a_user_opens_the_app_from_a_clean_installation_displays_the_welcome_screen",
121
+ "The step timed out after 2.00 seconds: Failed to find accessibility element with the label \"The asimplest way to make smarter business decisions\"",
122
+ "/Users/vickeryj/Code/ipad-register/KIFTests/Specs/SKWelcomeViewControllerSpec.m:11")
123
+ @parser.parse(SAMPLE_SPECTA_FAILURE)
124
+ end
125
+
126
+ it "parses old specta failing tests" do
107
127
  @formatter.should receive(:format_failing_test).with("RACCommandSpec",
108
128
  "enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES",
109
129
  "expected: 1, got: 0",
110
- #"expect([command.enabled first]).to.equal(@YES);", # outside of PR scope
111
130
  "/Users/musalj/code/OSS/ReactiveCocoa/ReactiveCocoaFramework/ReactiveCocoaTests/RACCommandSpec.m:458")
112
- @parser.parse(SAMPLE_SPECTA_FAILURE)
131
+ @parser.parse(SAMPLE_OLD_SPECTA_FAILURE)
113
132
  end
114
133
 
115
- it "parses passing tests" do
134
+ it "parses passing ocunit tests" do
116
135
  @formatter.should receive(:format_passing_test).with('RACCommandSpec',
117
136
  'enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES',
118
137
  '0.001')
119
138
  @parser.parse(SAMPLE_OCUNIT_TEST)
120
139
  end
121
140
 
141
+ it "parses passing specta tests" do
142
+ @formatter.should receive(:format_passing_test).with('SKWelcomeActivationViewControllerSpecSpec',
143
+ 'SKWelcomeActivationViewController_When_a_user_enters_their_details_lets_them_enter_a_valid_manager_code',
144
+ '0.725')
145
+ @parser.parse(SAMPLE_SPECTA_TEST)
146
+ end
147
+
122
148
  it "parses pending tests" do
123
149
  @formatter.should receive(:format_pending_test).with('TAPIConversationSpec',
124
150
  'TAPIConversation_createConversation_SendsAPOSTRequestToTheConversationsEndpoint')
@@ -167,21 +193,36 @@ module XCPretty
167
193
  end
168
194
  end
169
195
 
170
- it "parses test run finished" do
196
+ it "parses ocunit test run finished" do
171
197
  @formatter.should receive(:format_test_run_finished).with('ReactiveCocoaTests.octest(Tests)', '2013-12-10 07:03:03 +0000.')
172
198
  @parser.parse(SAMPLE_OCUNIT_TEST_RUN_COMPLETION)
173
199
  end
174
200
 
175
- it "parses test run started" do
201
+ it "parses specta test run finished" do
202
+ @formatter.should receive(:format_test_run_finished).with('KIFTests.xctest', '2014-02-28 15:44:32 +0000.')
203
+ @parser.parse(SAMPLE_SPECTA_TEST_RUN_COMPLETION)
204
+ end
205
+
206
+ it "parses ocunit test run started" do
176
207
  @formatter.should receive(:format_test_run_started).with('ReactiveCocoaTests.octest(Tests)')
177
208
  @parser.parse(SAMPLE_OCUNIT_TEST_RUN_BEGINNING)
178
209
  end
179
210
 
180
- it "parses test suite started" do
211
+ it "parses specta test run started" do
212
+ @formatter.should receive(:format_test_run_started).with('KIFTests.xctest')
213
+ @parser.parse(SAMPLE_SPECTA_TEST_RUN_BEGINNING)
214
+ end
215
+
216
+ it "parses ocunit test suite started" do
181
217
  @formatter.should receive(:format_test_suite_started).with('RACKVOWrapperSpec')
182
218
  @parser.parse(SAMPLE_OCUNIT_SUITE_BEGINNING)
183
219
  end
184
220
 
221
+ it "parses specta test suite started" do
222
+ @formatter.should receive(:format_test_suite_started).with('All tests')
223
+ @parser.parse(SAMPLE_SPECTA_SUITE_BEGINNING)
224
+ end
225
+
185
226
  context "errors" do
186
227
 
187
228
  it "parses clang errors" do
@@ -311,12 +352,18 @@ module XCPretty
311
352
  @parser.parse(SAMPLE_EXECUTED_TESTS).should == ""
312
353
  end
313
354
 
314
- it "knows when the test suite is done for OCunit / Specta" do
355
+ it "knows when the test suite is done for OCunit" do
315
356
  given_tests_are_done
316
357
  @formatter.should receive(:format_test_summary)
317
358
  @parser.parse(SAMPLE_EXECUTED_TESTS)
318
359
  end
319
360
 
361
+ it "knows when the test suite is done for Specta" do
362
+ given_tests_are_done
363
+ @formatter.should receive(:format_test_summary)
364
+ @parser.parse(SAMPLE_SPECTA_EXECUTED_TESTS)
365
+ end
366
+
320
367
  it "doesn't print executed message twice for Kiwi tests" do
321
368
  @formatter.should_receive(:format_test_summary).once
322
369
  given_tests_have_started(SAMPLE_KIWI_TEST_RUN_BEGINNING)
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.3
4
+ version: 0.1.4
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-02-08 00:00:00.000000000 Z
12
+ date: 2014-03-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -93,6 +93,7 @@ files:
93
93
  - features/fixtures/xcodebuild.log
94
94
  - features/html_report.feature
95
95
  - features/junit_report.feature
96
+ - features/knock_format.feature
96
97
  - features/simple_format.feature
97
98
  - features/steps/formatting_steps.rb
98
99
  - features/steps/html_steps.rb
@@ -100,13 +101,16 @@ files:
100
101
  - features/steps/report_steps.rb
101
102
  - features/steps/xcpretty_steps.rb
102
103
  - features/support/env.rb
104
+ - features/tap_format.feature
103
105
  - features/test_format.feature
104
106
  - features/xcpretty.feature
105
107
  - lib/xcpretty.rb
106
108
  - lib/xcpretty/ansi.rb
107
109
  - lib/xcpretty/formatters/formatter.rb
110
+ - lib/xcpretty/formatters/knock.rb
108
111
  - lib/xcpretty/formatters/rspec.rb
109
112
  - lib/xcpretty/formatters/simple.rb
113
+ - lib/xcpretty/formatters/tap.rb
110
114
  - lib/xcpretty/parser.rb
111
115
  - lib/xcpretty/printer.rb
112
116
  - lib/xcpretty/reporters/html.rb
@@ -157,6 +161,7 @@ test_files:
157
161
  - features/fixtures/xcodebuild.log
158
162
  - features/html_report.feature
159
163
  - features/junit_report.feature
164
+ - features/knock_format.feature
160
165
  - features/simple_format.feature
161
166
  - features/steps/formatting_steps.rb
162
167
  - features/steps/html_steps.rb
@@ -164,6 +169,7 @@ test_files:
164
169
  - features/steps/report_steps.rb
165
170
  - features/steps/xcpretty_steps.rb
166
171
  - features/support/env.rb
172
+ - features/tap_format.feature
167
173
  - features/test_format.feature
168
174
  - features/xcpretty.feature
169
175
  - spec/fixtures/constants.rb