ocrunner 0.2.4 → 0.2.5
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.
- data/VERSION +1 -1
- data/lib/ocrunner/cli.rb +1 -0
- data/lib/ocrunner/test_case.rb +9 -0
- data/lib/ocrunner/test_runner.rb +21 -10
- data/ocrunner.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.5
|
data/lib/ocrunner/cli.rb
CHANGED
@@ -25,6 +25,7 @@ module OCRunner
|
|
25
25
|
opt :growl, "Report results using Growl", :type => :boolean, :default => false
|
26
26
|
opt :debug_command, "Print xcodebuild command and exit", :type => :boolean, :default => false
|
27
27
|
opt :verbose, "Display all xcodebuild output after summary", :type => :boolean, :default => false
|
28
|
+
opt :loud_compilation, "Always show verbose output when a compilation or linking error occurs", :type => :boolean, :default => true
|
28
29
|
end
|
29
30
|
|
30
31
|
execute = Proc.new{ OCRunner::TestRunner.new(opts) }
|
data/lib/ocrunner/test_case.rb
CHANGED
data/lib/ocrunner/test_runner.rb
CHANGED
@@ -23,7 +23,7 @@ module OCRunner
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def setup
|
26
|
-
puts "
|
26
|
+
puts "-"*80
|
27
27
|
puts
|
28
28
|
end
|
29
29
|
|
@@ -49,7 +49,7 @@ module OCRunner
|
|
49
49
|
def summarize
|
50
50
|
|
51
51
|
@suites.each do |suite|
|
52
|
-
suite.cases.reject {|kase| kase.passed}.each do |kase|
|
52
|
+
suite.cases.reject {|kase| kase.passed?}.each do |kase|
|
53
53
|
out
|
54
54
|
out ' ' + red("[#{suite.name} #{kase.name}] FAIL")
|
55
55
|
kase.errors.each do |error|
|
@@ -60,7 +60,7 @@ module OCRunner
|
|
60
60
|
end
|
61
61
|
|
62
62
|
@suites.each do |suite|
|
63
|
-
failed = suite.cases.reject {|
|
63
|
+
failed = suite.cases.reject {|kase| kase.passed?}
|
64
64
|
out "Suite '#{suite.name}': #{suite.cases.size - failed.size} passes and #{failed.size} failures in #{suite.time} seconds."
|
65
65
|
end
|
66
66
|
|
@@ -74,7 +74,8 @@ module OCRunner
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def display_results
|
77
|
-
puts
|
77
|
+
puts
|
78
|
+
puts @log if @options[:verbose] || (compilation_error_occurred && @options[:loud_compilation])
|
78
79
|
puts @output.join("\n")
|
79
80
|
puts
|
80
81
|
end
|
@@ -104,15 +105,13 @@ module OCRunner
|
|
104
105
|
|
105
106
|
# test case passed
|
106
107
|
if line =~ /Test Case .+ passed/
|
107
|
-
@current_case.passed = true
|
108
|
-
@current_suite.cases << @current_case
|
109
108
|
@current_case = nil
|
110
109
|
print(green('.'))
|
111
110
|
end
|
112
111
|
|
113
112
|
# test failure
|
114
|
-
if line =~ /(.+\.m):(\d+): error: -\[(.+) (.+)\] :(?: (.+):?)
|
115
|
-
@current_case.
|
113
|
+
if line =~ /(.+\.m):(\d+): error: -\[(.+) (.+)\] :(?: (.+):?)?/
|
114
|
+
@current_case.fail!
|
116
115
|
@current_case.errors << TestError.new($1, $2, $5)
|
117
116
|
@passed = false
|
118
117
|
print red('.')
|
@@ -121,14 +120,13 @@ module OCRunner
|
|
121
120
|
# start test suite
|
122
121
|
if line =~ /Test Suite '([^\/]+)' started/
|
123
122
|
@current_suite = TestSuite.new($1)
|
123
|
+
@suites << @current_suite
|
124
124
|
print "#{$1} "
|
125
125
|
end
|
126
126
|
|
127
127
|
# finish test suite
|
128
128
|
if @current_suite && line =~ /^Executed/ && line =~ /\(([\d\.]+)\) seconds/
|
129
129
|
@current_suite.time = $1
|
130
|
-
@suites << @current_suite
|
131
|
-
@current_suite = nil
|
132
130
|
print "\n" # clear console line
|
133
131
|
end
|
134
132
|
|
@@ -137,16 +135,29 @@ module OCRunner
|
|
137
135
|
build_error("Test executable #{clean_path($1)} could not be found")
|
138
136
|
end
|
139
137
|
|
138
|
+
# compilation errors
|
139
|
+
if line =~ /(.+\.m):(\d+): error: (.*)/
|
140
|
+
compilation_error_occurred!
|
141
|
+
build_error($&)
|
142
|
+
end
|
143
|
+
|
140
144
|
# compilation reference error
|
141
145
|
if line =~ /"(.+)", referenced from:/
|
142
146
|
compilation_error_occurred!
|
143
147
|
build_error($&)
|
144
148
|
end
|
149
|
+
|
150
|
+
# linking error
|
145
151
|
if line =~ /-\[\w+ \w+\] in .+\.o/
|
146
152
|
compilation_error_occurred!
|
147
153
|
build_error($&)
|
148
154
|
end
|
149
155
|
|
156
|
+
# segfault
|
157
|
+
if line =~ /Segmentation fault/
|
158
|
+
build_error('Segmentation fault while running tests.')
|
159
|
+
end
|
160
|
+
|
150
161
|
# no Xcode project found
|
151
162
|
if line =~ /does not contain an Xcode project/
|
152
163
|
build_error('No Xcode project was found.')
|
data/ocrunner.gemspec
CHANGED