Class: Raven::JUnitTask
Instance Method Summary
collapse
Methods inherited from JavacTask
#build_path, #build_path=
Instance Method Details
#execute ⇒ Object
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
|
# File 'lib/raven/java_tasks.rb', line 91
def execute
@build_path = ["src/test/java"] unless @build_path
super
unless @test_classes
tests = @build_path.collect { |d| Dir.glob("#{d}/**/Test*.java").collect { |sd| sd[d.size+1..-1] } }
@test_classes = tests.flatten.collect { |d| d.gsub('/', '.')[0..-6] }
end
failures = false
@test_classes.flatten.each do |tc|
puts "Running test #{tc}"
result = `java -classpath "#{@classpath.join(CP_SEP)}" junit.textui.TestRunner #{tc}`
puts result
failures = true if /FAILURES/ =~ result || /ERRORS/ =~ result
end
if failures
puts "There were failures!"
exit(1)
end
end
|
#test_classes ⇒ Object
111
112
113
|
# File 'lib/raven/java_tasks.rb', line 111
def test_classes
@test_classes ||= []
end
|
#test_classes=(c) ⇒ Object
115
116
117
|
# File 'lib/raven/java_tasks.rb', line 115
def test_classes=(c)
@test_classes = [c]
end
|