xcpretty 0.0.2 → 0.0.3
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 +4 -1
- data/README.md +4 -2
- data/bin/xcpretty +2 -2
- data/features/steps/formatting_steps.rb +1 -1
- data/features/support/env.rb +3 -1
- data/lib/xcpretty/printer.rb +17 -17
- data/lib/xcpretty/printers/rspec.rb +1 -2
- data/lib/xcpretty/printers/simple.rb +1 -1
- data/lib/xcpretty/version.rb +1 -1
- data/spec/xcpretty/printers/printer_spec.rb +2 -3
- data/spec/xcpretty/printers/simple_spec.rb +7 -7
- data/xcpretty.gemspec +2 -1
- 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: 312a49c2395ef4423b388d5308643954924f487f
|
4
|
+
data.tar.gz: 6253bca6389c6956b2fbbc1ae6919294740462b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7edfc065c451e809dbda04ce749165288d2c3f1896179dd8cf98a7d9d591ec6a042e0524ba1d9ba69a7b0d40a4baded7c9ec2db3633294472d1dc9264313cdf
|
7
|
+
data.tar.gz: d8fac2769db30fedaa440aa23921dc2d0004ae6aab59a83fb50b42785b5230308e483b276a110be07880ddcbcbac31232a6bc6a8df9b933cbba3a96e69d7fe6e
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# XCPretty
|
1
|
+
# XCPretty [](https://travis-ci.org/mneorr/XCPretty)
|
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.
|
@@ -7,6 +7,8 @@ It does one thing, and it should do it well.
|
|
7
7
|
|
8
8
|
$ gem install xcpretty
|
9
9
|
|
10
|
+
XCPretty requires Ruby 1.8.7 or above.
|
11
|
+
|
10
12
|
## Usage
|
11
13
|
|
12
14
|
XCPretty is designed to be piped with `xcodebuild` and thus keeping 100% compatibility with it.
|
@@ -19,7 +21,7 @@ It's even a bit faster than `xcodebuild` only, since it saves your terminal some
|
|
19
21
|
- --simple, -s (default)
|
20
22
|

|
21
23
|
|
22
|
-
- --test, -t (RSpec style
|
24
|
+
- --test, -t (RSpec style)
|
23
25
|

|
24
26
|
|
25
27
|
- tun / tap (not yet implemented. possible solution for most CI servers)
|
data/bin/xcpretty
CHANGED
@@ -3,8 +3,8 @@ $:.unshift File.expand_path('../../lib', __FILE__)
|
|
3
3
|
require 'xcpretty'
|
4
4
|
require 'optparse'
|
5
5
|
|
6
|
-
if RUBY_VERSION < '1.
|
7
|
-
abort "error: XCPretty requires Ruby 1.
|
6
|
+
if RUBY_VERSION < '1.8.7'
|
7
|
+
abort "error: XCPretty requires Ruby 1.8.7 or higher."
|
8
8
|
end
|
9
9
|
|
10
10
|
def printer
|
@@ -56,7 +56,7 @@ Then(/^I should see a red failed test icon$/) do
|
|
56
56
|
end
|
57
57
|
|
58
58
|
Then(/^the final execution message should be (red|green)$/) do |color|
|
59
|
-
last_line = run_output.lines.last
|
59
|
+
last_line = run_output.lines.to_a.last
|
60
60
|
start_color = color == "red" ? RED_START : GREEN_START
|
61
61
|
last_line.should start_with(start_color)
|
62
62
|
last_line.strip.should end_with(COLOR_END)
|
data/features/support/env.rb
CHANGED
@@ -18,7 +18,9 @@ def run_xcpretty flags
|
|
18
18
|
add_run_input SAMPLE_OCUNIT_SUITE_COMPLETION
|
19
19
|
add_run_input SAMPLE_EXECUTED_TESTS
|
20
20
|
input_file = Tempfile.new(INPUT_FILE)
|
21
|
-
File.
|
21
|
+
File.open(input_file.path, 'w') do |file|
|
22
|
+
file.print run_input
|
23
|
+
end
|
22
24
|
@output = %x(cat '#{input_file.path}' | bin/xcpretty #{flags})
|
23
25
|
input_file.unlink
|
24
26
|
end
|
data/lib/xcpretty/printer.rb
CHANGED
@@ -2,15 +2,15 @@ require "paint"
|
|
2
2
|
|
3
3
|
module XCPretty
|
4
4
|
|
5
|
-
|
5
|
+
module Printer
|
6
6
|
|
7
|
-
|
7
|
+
attr_accessor :colorize
|
8
8
|
|
9
9
|
# @regex Captured groups
|
10
10
|
# $1 = file
|
11
11
|
# $2 = test_case
|
12
12
|
# $3 = failure_message
|
13
|
-
|
13
|
+
FAILING_TEST_MATCHER = /(.+:\d+):\serror:\s[\+\-]\[(.*)\]\s:(?:\s'.*'\s\[FAILED\],)?\s(.*)/
|
14
14
|
|
15
15
|
# @regex Captured groups
|
16
16
|
# $1 = test_case
|
@@ -23,16 +23,16 @@ module XCPretty
|
|
23
23
|
TESTS_START_MATCHER = /Test Suite ('.*(\.(o|x)ctest(.*))?') started at/
|
24
24
|
EXECUTED_MATCHER = /^Executed/
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
Paint::SHORTCUTS[:printer] = {
|
27
|
+
:white => Paint.color(:bold),
|
28
28
|
:red => Paint.color(:red),
|
29
29
|
:green => Paint.color(:green, :bright),
|
30
30
|
:link => Paint.color(:cyan),
|
31
31
|
}
|
32
32
|
|
33
|
-
|
33
|
+
include Paint::Printer
|
34
34
|
|
35
|
-
|
35
|
+
def pretty_print(text)
|
36
36
|
update_test_state(text)
|
37
37
|
formatted_text = pretty_format(text)
|
38
38
|
formatted_text = format_test_summary(text) if formatted_text.empty?
|
@@ -81,10 +81,10 @@ module XCPretty
|
|
81
81
|
"#{f[:test_case]}, #{reason}\n#{path}"
|
82
82
|
end.join("\n\n")
|
83
83
|
final_message = if colorize?
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
84
|
+
failures.any? ? red(executed_message) : green(executed_message)
|
85
|
+
else
|
86
|
+
executed_message
|
87
|
+
end
|
88
88
|
text = [formatted_failures, final_message].join("\n\n\n").strip
|
89
89
|
"\n\n#{text}"
|
90
90
|
end
|
@@ -93,16 +93,16 @@ module XCPretty
|
|
93
93
|
@failures ||= []
|
94
94
|
end
|
95
95
|
|
96
|
-
|
96
|
+
def store_failure(file, test_case, failure_message)
|
97
97
|
failures << {
|
98
|
-
file
|
99
|
-
test_case
|
100
|
-
failure_message
|
98
|
+
:file => file,
|
99
|
+
:test_case => test_case,
|
100
|
+
:failure_message => failure_message
|
101
101
|
}
|
102
102
|
end
|
103
103
|
|
104
104
|
def colorize?
|
105
|
-
|
105
|
+
!!@colorize
|
106
106
|
end
|
107
|
-
|
107
|
+
end
|
108
108
|
end
|
data/lib/xcpretty/version.rb
CHANGED
@@ -6,7 +6,7 @@ module XCPretty
|
|
6
6
|
module Printer
|
7
7
|
|
8
8
|
describe Printer do
|
9
|
-
|
9
|
+
|
10
10
|
include Printer
|
11
11
|
|
12
12
|
def pretty_format(text)
|
@@ -37,7 +37,7 @@ module XCPretty
|
|
37
37
|
given_tests_are_done
|
38
38
|
executed_tests_message.should == "\n\n#{SAMPLE_EXECUTED_TESTS}"
|
39
39
|
end
|
40
|
-
|
40
|
+
|
41
41
|
it "knows when the test suite is done for XCtest" do
|
42
42
|
executed_tests_message.should == ""
|
43
43
|
|
@@ -72,7 +72,6 @@ RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsC
|
|
72
72
|
given_kiwi_tests_are_done
|
73
73
|
executed_tests_message.should == ""
|
74
74
|
end
|
75
|
-
|
76
75
|
end
|
77
76
|
end
|
78
77
|
end
|
@@ -7,7 +7,7 @@ module XCPretty
|
|
7
7
|
module Printer
|
8
8
|
|
9
9
|
describe Simple do
|
10
|
-
|
10
|
+
|
11
11
|
it "prints to stdout" do
|
12
12
|
STDOUT.should receive(:print)
|
13
13
|
subject.pretty_print(SAMPLE_CLEAN)
|
@@ -32,7 +32,7 @@ module XCPretty
|
|
32
32
|
subject.pretty_format(SAMPLE_PRECOMPILE).should ==
|
33
33
|
"Precompiling Pods-CocoaLumberjack-prefix.pch"
|
34
34
|
end
|
35
|
-
|
35
|
+
|
36
36
|
it "parses another precompiling output" do
|
37
37
|
subject.pretty_format(SAMPLE_ANOTHER_PRECOMPILE).should ==
|
38
38
|
"Precompiling Pods-CrittercismSDK-prefix.pch"
|
@@ -45,7 +45,7 @@ module XCPretty
|
|
45
45
|
it "kills 'Check dependencies'" do
|
46
46
|
subject.pretty_format("Check dependencies").should == ""
|
47
47
|
end
|
48
|
-
|
48
|
+
|
49
49
|
it "parses clean target/project/configuration" do
|
50
50
|
subject.pretty_format(SAMPLE_CLEAN).should ==
|
51
51
|
"Cleaning Pods/ObjectiveSugar [Debug]"
|
@@ -82,7 +82,7 @@ module XCPretty
|
|
82
82
|
end
|
83
83
|
|
84
84
|
it "parses CopyStringsFile" do
|
85
|
-
subject.pretty_format(SAMPLE_COPYSTRINGS).should ==
|
85
|
+
subject.pretty_format(SAMPLE_COPYSTRINGS).should ==
|
86
86
|
"Copying InfoPlist.strings"
|
87
87
|
end
|
88
88
|
|
@@ -97,17 +97,17 @@ module XCPretty
|
|
97
97
|
end
|
98
98
|
|
99
99
|
it "parses Ld" do
|
100
|
-
subject.pretty_format(SAMPLE_LD).should ==
|
100
|
+
subject.pretty_format(SAMPLE_LD).should ==
|
101
101
|
"Linking ObjectiveSugar"
|
102
102
|
end
|
103
103
|
|
104
104
|
it "parses passing tests" do
|
105
|
-
subject.pretty_format(SAMPLE_OCUNIT_TEST).should ==
|
105
|
+
subject.pretty_format(SAMPLE_OCUNIT_TEST).should ==
|
106
106
|
"RACTupleSpec _tupleByAddingObject__should_add_a_non_nil_object (0.001 seconds)"
|
107
107
|
end
|
108
108
|
|
109
109
|
it "parses failing tests" do
|
110
|
-
subject.pretty_format(SAMPLE_SPECTA_FAILURE).should ==
|
110
|
+
subject.pretty_format(SAMPLE_SPECTA_FAILURE).should ==
|
111
111
|
"RACCommandSpec enabled_signal_should_send_YES_while_executing_is_YES_and_allowsConcurrentExecution_is_YES, expected: 1, got: 0"
|
112
112
|
end
|
113
113
|
|
data/xcpretty.gemspec
CHANGED
@@ -8,7 +8,8 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.version = XCPretty::VERSION
|
9
9
|
spec.authors = ["Marin Usalj", "Delisa Mason"]
|
10
10
|
spec.email = ["mneorr@gmail.com", "kattrali@gmail.com"]
|
11
|
-
spec.
|
11
|
+
spec.required_ruby_version = '>= 1.8.7'
|
12
|
+
spec.description =
|
12
13
|
%q{
|
13
14
|
Xcodebuild formatter designed to be piped with `xcodebuild`,
|
14
15
|
and thus keeping 100% compatibility.
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marin Usalj
|
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
126
126
|
requirements:
|
127
127
|
- - '>='
|
128
128
|
- !ruby/object:Gem::Version
|
129
|
-
version:
|
129
|
+
version: 1.8.7
|
130
130
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
131
131
|
requirements:
|
132
132
|
- - '>='
|