buildr 1.4.6-x86-mswin32 → 1.4.7-x86-mswin32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. data/CHANGELOG +81 -0
  2. data/Rakefile +5 -2
  3. data/addon/buildr/antlr.rb +0 -4
  4. data/addon/buildr/bnd.rb +3 -1
  5. data/addon/buildr/checkstyle.rb +201 -0
  6. data/addon/buildr/cobertura.rb +0 -1
  7. data/addon/buildr/drb.rb +0 -2
  8. data/addon/buildr/emma.rb +0 -1
  9. data/addon/buildr/findbugs.rb +227 -0
  10. data/addon/buildr/gwt.rake +82 -0
  11. data/addon/buildr/hibernate.rb +0 -4
  12. data/addon/buildr/javacc.rb +0 -4
  13. data/addon/buildr/javancss.rb +155 -0
  14. data/addon/buildr/jdepend.rb +138 -24
  15. data/addon/buildr/jdepend.rb.orig +178 -0
  16. data/addon/buildr/jetty.rb +0 -5
  17. data/addon/buildr/jibx.rb +85 -86
  18. data/addon/buildr/nailgun.rb +2 -2
  19. data/addon/buildr/openjpa.rb +0 -4
  20. data/addon/buildr/pmd.rb +166 -0
  21. data/addon/buildr/protobuf.rb +0 -1
  22. data/addon/buildr/sonar.rb +142 -0
  23. data/addon/buildr/xmlbeans.rb +0 -5
  24. data/buildr.gemspec +36 -21
  25. data/doc/_layouts/default.html +1 -0
  26. data/doc/contributing.textile +11 -2
  27. data/doc/download.textile +17 -5
  28. data/doc/index.textile +21 -46
  29. data/doc/installing.textile +18 -8
  30. data/doc/installing.textile.orig +282 -0
  31. data/doc/languages.textile +0 -38
  32. data/doc/more_stuff.textile +199 -12
  33. data/doc/more_stuff.textile.orig +1004 -0
  34. data/doc/packaging.textile +10 -0
  35. data/doc/settings_profiles.textile +2 -2
  36. data/etc/KEYS +44 -0
  37. data/lib/buildr.rb +67 -4
  38. data/lib/buildr/clojure.rb +0 -2
  39. data/lib/buildr/core/application.rb +23 -32
  40. data/lib/buildr/core/build.rb +0 -7
  41. data/lib/buildr/core/cc.rb +0 -5
  42. data/lib/buildr/core/checks.rb +0 -4
  43. data/lib/buildr/core/common.rb +0 -5
  44. data/lib/buildr/core/compile.rb +5 -10
  45. data/lib/buildr/core/doc.rb +9 -3
  46. data/lib/buildr/core/environment.rb +0 -1
  47. data/lib/buildr/core/filter.rb +0 -5
  48. data/lib/buildr/core/generate.rb +2 -6
  49. data/lib/buildr/core/help.rb +1 -6
  50. data/lib/buildr/core/linux.rb +0 -1
  51. data/lib/buildr/core/osx.rb +0 -1
  52. data/lib/buildr/core/project.rb +0 -4
  53. data/lib/buildr/core/run.rb +1 -5
  54. data/lib/buildr/core/shell.rb +1 -6
  55. data/lib/buildr/core/test.rb +1 -7
  56. data/lib/buildr/core/transports.rb +4 -6
  57. data/lib/buildr/core/util.rb +2 -65
  58. data/lib/buildr/groovy/doc.rb +0 -3
  59. data/lib/buildr/groovy/shell.rb +0 -2
  60. data/lib/buildr/ide/eclipse.rb +4 -13
  61. data/lib/buildr/ide/eclipse/java.rb +0 -4
  62. data/lib/buildr/ide/eclipse/plugin.rb +0 -4
  63. data/lib/buildr/ide/eclipse/scala.rb +0 -4
  64. data/lib/buildr/ide/idea.rb +284 -52
  65. data/lib/buildr/java/ant.rb +2 -6
  66. data/lib/buildr/java/bdd.rb +5 -123
  67. data/lib/buildr/java/cobertura.rb +16 -10
  68. data/lib/buildr/java/commands.rb +33 -7
  69. data/lib/buildr/java/compiler.rb +0 -7
  70. data/lib/buildr/java/deprecated.rb +0 -4
  71. data/lib/buildr/java/doc.rb +0 -2
  72. data/lib/buildr/java/emma.rb +0 -4
  73. data/lib/buildr/java/jruby.rb +0 -2
  74. data/lib/buildr/java/packaging.rb +0 -4
  75. data/lib/buildr/java/pom.rb +24 -16
  76. data/lib/buildr/java/rjb.rb +1 -1
  77. data/lib/buildr/java/test_result.rb +1 -2
  78. data/lib/buildr/java/tests.rb +68 -6
  79. data/lib/buildr/packaging/archive.rb +0 -1
  80. data/lib/buildr/packaging/artifact.rb +19 -16
  81. data/lib/buildr/packaging/artifact_namespace.rb +51 -24
  82. data/lib/buildr/packaging/artifact_search.rb +1 -2
  83. data/lib/buildr/packaging/gems.rb +1 -13
  84. data/lib/buildr/packaging/package.rb +0 -6
  85. data/lib/buildr/packaging/tar.rb +2 -4
  86. data/lib/buildr/packaging/version_requirement.rb +1 -1
  87. data/lib/buildr/packaging/zip.rb +1 -2
  88. data/lib/buildr/packaging/ziptask.rb +0 -4
  89. data/lib/buildr/run.rb +3 -3
  90. data/lib/buildr/scala/bdd.rb +129 -11
  91. data/lib/buildr/scala/compiler.rb +53 -6
  92. data/lib/buildr/scala/doc.rb +6 -4
  93. data/lib/buildr/scala/org/apache/buildr/Specs2Runner.class +0 -0
  94. data/lib/buildr/scala/org/apache/buildr/Specs2Runner.java +38 -0
  95. data/lib/buildr/scala/shell.rb +0 -4
  96. data/lib/buildr/scala/tests.rb +15 -6
  97. data/lib/buildr/shell.rb +0 -1
  98. data/lib/buildr/version.rb +1 -1
  99. data/rakelib/all-in-one.rake +20 -11
  100. data/rakelib/checks.rake +0 -31
  101. data/rakelib/doc.rake +86 -100
  102. data/rakelib/package.rake +3 -3
  103. data/rakelib/release.rake +1 -1
  104. data/rakelib/rspec.rake +23 -7
  105. data/rakelib/stage.rake +18 -21
  106. data/spec/addon/bnd_spec.rb +2 -2
  107. data/spec/addon/jaxb_xjc_spec.rb +5 -0
  108. data/spec/core/application_spec.rb +11 -64
  109. data/spec/core/cc_spec.rb +12 -5
  110. data/spec/core/compile_spec.rb +11 -0
  111. data/spec/core/doc_spec.rb +1 -1
  112. data/spec/core/run_spec.rb +17 -4
  113. data/spec/core/test_spec.rb +5 -3
  114. data/spec/ide/idea_spec.rb +60 -0
  115. data/spec/java/bdd_spec.rb +8 -218
  116. data/spec/java/cobertura_spec.rb +4 -0
  117. data/spec/java/compiler_spec.rb +11 -8
  118. data/spec/java/emma_spec.rb +4 -1
  119. data/spec/java/java_spec.rb +1 -1
  120. data/spec/java/pom_spec.rb +125 -0
  121. data/spec/java/tests_spec.rb +185 -0
  122. data/spec/packaging/archive_spec.rb +1 -1
  123. data/spec/packaging/artifact_namespace_spec.rb +15 -0
  124. data/spec/packaging/artifact_spec.rb +26 -1
  125. data/spec/sandbox.rb +7 -1
  126. data/spec/scala/bdd_spec.rb +111 -8
  127. data/spec/scala/tests_spec.rb +5 -1
  128. data/spec/spec_helpers.rb +9 -4
  129. data/spec/version_requirement_spec.rb +2 -0
  130. metadata +570 -505
  131. data/lib/buildr/core.rb +0 -34
  132. data/lib/buildr/ide.rb +0 -19
  133. data/lib/buildr/java.rb +0 -25
  134. data/lib/buildr/java/jtestr_result.rb +0 -331
  135. data/lib/buildr/java/jtestr_runner.rb.erb +0 -116
  136. data/lib/buildr/packaging.rb +0 -25
  137. data/rakelib/setup.rake +0 -68
data/lib/buildr/core.rb DELETED
@@ -1,34 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
- require 'buildr/core/common'
17
- require 'buildr/core/application'
18
- require 'buildr/core/jrebel'
19
- require 'buildr/core/project'
20
- require 'buildr/core/environment'
21
- require 'buildr/core/help'
22
- require 'buildr/core/build'
23
- require 'buildr/core/filter'
24
- require 'buildr/core/compile'
25
- require 'buildr/core/test'
26
- require 'buildr/core/shell'
27
- require 'buildr/core/run'
28
- require 'buildr/core/checks'
29
- require 'buildr/core/transports'
30
- require 'buildr/core/generate'
31
- require 'buildr/core/cc'
32
- require 'buildr/core/osx' if RUBY_PLATFORM =~ /darwin/
33
- require 'buildr/core/linux' if RUBY_PLATFORM =~ /linux/
34
-
data/lib/buildr/ide.rb DELETED
@@ -1,19 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
-
17
- require 'buildr/ide/eclipse'
18
- require 'buildr/ide/idea'
19
-
data/lib/buildr/java.rb DELETED
@@ -1,25 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
-
17
- require RUBY_PLATFORM == 'java' ? 'buildr/java/jruby' : 'buildr/java/rjb'
18
- require 'buildr/java/compiler'
19
- require 'buildr/java/external'
20
- require 'buildr/java/tests'
21
- require 'buildr/java/bdd'
22
- require 'buildr/java/packaging'
23
- require 'buildr/java/commands'
24
- require 'buildr/java/doc'
25
- require 'buildr/java/deprecated'
@@ -1,331 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
- # necessary to require YAML even if it is mentioned by autoload as it fails on some platforms.
17
- require 'yaml'
18
- require 'fileutils'
19
-
20
- module Buildr #:nodoc:
21
-
22
- module TestFramework
23
-
24
- # A class used by buildr for jruby based frameworks, so that buildr can know
25
- # which tests succeeded/failed.
26
- class TestResult
27
-
28
- class Error < ::Exception
29
- attr_reader :message, :backtrace
30
- def initialize(message, backtrace)
31
- @message = message
32
- @backtrace = backtrace
33
- set_backtrace backtrace
34
- end
35
-
36
- def self.dump_yaml(file, e)
37
- FileUtils.mkdir_p File.dirname(file)
38
- File.open(file, 'w') { |f| f.puts(YAML.dump(Error.new(e.message, e.backtrace))) }
39
- end
40
-
41
- def self.guard(file)
42
- begin
43
- yield
44
- rescue => e
45
- dump_yaml(file, e)
46
- end
47
- end
48
- end
49
-
50
- attr_accessor :failed, :succeeded
51
-
52
- def initialize
53
- @failed, @succeeded = [], []
54
- end
55
- end
56
- end
57
-
58
- module JtestR
59
-
60
- # An Rspec formatter used by JtestR
61
- class YamlFormatter
62
- attr_reader :result
63
-
64
- attr_accessor :example_group, :options, :where
65
-
66
- def initialize(options, where)
67
- @options = options
68
- @where = where
69
- end
70
-
71
- %w[ example_started
72
- start_dump dump_failure dump_summary dump_pending ].each do |meth|
73
- module_eval "def #{meth}(*args); end"
74
- end
75
-
76
- def example_group_started(example_group)
77
- @example_group = example_group
78
- end
79
-
80
- def example_passed(example)
81
- result.succeeded << example_name(example)
82
- end
83
-
84
- def example_pending(example, counter)
85
- result.succeeded << example_name(example)
86
- end
87
-
88
- def example_failed(example, counter, failure)
89
- result.failed << example_name(example)
90
- end
91
-
92
- def start(example_count)
93
- @result = Buildr::TestFramework::TestResult.new
94
- end
95
-
96
- def close
97
- result.succeeded = result.succeeded - result.failed
98
- FileUtils.mkdir_p File.dirname(where)
99
- File.open(where, 'w') { |f| f.puts YAML.dump(result) }
100
- end
101
-
102
- private
103
- def example_name(example)
104
- if Spec::Example::ExampleProxy === example
105
- example_group.location.gsub(/:\d+$/, '')
106
- else
107
- example.name.gsub(/(.+)(\..+\(\))/, '\1')
108
- end
109
- end
110
- end # YamlFormatter
111
-
112
- # A JtestR ResultHandler
113
- # Using this handler we can use RSpec formatters, like html/ci_reporter with JtestR
114
- # Created for JTestrYamlFormatter
115
- class ResultHandler
116
-
117
- # Workaround for http://jira.codehaus.org/browse/JTESTR-68
118
- module TestNGResultHandlerMixin
119
- def onTestSuccess(test_result)
120
- @result_handler.succeed_single(test_result.name)
121
- end
122
- end
123
-
124
- class BacktraceTweaker
125
- attr_reader :ignore_patterns
126
- def initialize
127
- @ignore_patterns = ::Spec::Runner::QuietBacktraceTweaker::IGNORE_PATTERNS.dup
128
- # ignore jruby/jtestr backtrace
129
- ignore_patterns << /org\.jruby\.javasupport\.JavaMethod\./
130
- ignore_patterns << /jtestr.*\.jar!/i << /runner\.rb/
131
- end
132
-
133
- def clean_up_double_slashes(line)
134
- line.gsub!('//','/')
135
- end
136
-
137
- def tweak_backtrace(error)
138
- return if error.backtrace.nil?
139
- error.backtrace.collect! do |line|
140
- clean_up_double_slashes(line)
141
- ignore_patterns.each do |ignore|
142
- if line =~ ignore
143
- line = nil
144
- break
145
- end
146
- end
147
- line
148
- end
149
- error.backtrace.compact!
150
- end
151
- end
152
-
153
- class << self
154
- # an rspec reporter used to proxy events to rspec formatters
155
- attr_reader :reporter
156
- attr_accessor :test_files
157
-
158
- def init(argv = [], out = STDOUT, err = STDERR)
159
- ::JtestR::TestNGResultHandler.module_eval { include TestNGResultHandlerMixin }
160
- rspec_parser = ::Spec::Runner::OptionParser.new(err, out)
161
- rspec_parser.order!(argv)
162
- rspec_parser.options.backtrace_tweaker = BacktraceTweaker.new
163
- @reporter = Spec::Runner::Reporter.new(rspec_parser.options)
164
- end
165
-
166
- def before
167
- reporter.start(reporter.options.files.size)
168
- end
169
-
170
- def after
171
- reporter.end
172
- reporter.dump
173
- end
174
-
175
- end
176
-
177
- module ExampleMethods
178
- attr_accessor :name, :description, :__full_description, :location
179
- end
180
-
181
- def reporter
182
- self.class.reporter
183
- end
184
-
185
- attr_accessor :example_group, :current_example, :current_failure
186
-
187
- def initialize(name, desc, *args)
188
- self.example_group = ::Spec::Example::ExampleGroup.new(desc)
189
- example_group.extend ExampleMethods
190
- example_group.name = name.to_s
191
- if example_group.name[/Spec/]
192
- example_group.description = desc.to_s
193
- else
194
- example_group.description = name.to_s
195
- end
196
- reporter.example_group_started(example_group)
197
- end
198
-
199
-
200
- def starting
201
- end
202
-
203
- def ending
204
- end
205
-
206
- def add_fault(fault)
207
- self.current_failure = fault
208
- end
209
-
210
- def add_pending(pending)
211
- end
212
-
213
- def starting_single(name = nil)
214
- self.current_failure = nil
215
- self.current_example = Object.new
216
- current_example.extend ::Spec::Example::ExampleMethods
217
- current_example.extend ExampleMethods
218
- name = name.to_s
219
- current_example.location = name.to_s
220
- current_example.name = name.gsub(/(.*)\((.+)\)/, '\2')
221
- current_example.description = name
222
- if example_group.name[/Spec/]
223
- current_example.__full_description = "#{example_group.description} #{name}"
224
- else
225
- current_example.__full_description = "#{example_group.name}: #{name}"
226
- end
227
- reporter.example_started(current_example)
228
- end
229
-
230
- def succeed_single(name = nil)
231
- reporter.example_finished(current_example, nil)
232
- end
233
-
234
- def fail_single(name = nil)
235
- current_example.name = current_name
236
- reporter.example_finished(current_example, current_error)
237
- end
238
-
239
- def error_single(name = nil)
240
- current_example.name = current_name
241
- reporter.example_finished(current_example, current_error)
242
- end
243
-
244
- def pending_single(name = nil)
245
- error = ::Spec::Example::ExamplePendingError.new(name)
246
- reporter.example_finished(current_example, error)
247
- end
248
-
249
- private
250
- def detect_file(trace)
251
- # find first matching test file in stacktrace
252
- file = nil
253
- first_pos = nil
254
- ResultHandler.test_files.each do |f|
255
- pos = trace.index(f)
256
- if pos && (first_pos.nil? || pos < first_pos)
257
- file = f
258
- first_pos = pos
259
- end
260
- end
261
- file || fail("JTestR::ResultHandler.detect_file failed: #{trace}")
262
- end
263
-
264
- def current_name(example = current_example, fault = current_failure)
265
- return example.name unless fault
266
- case fault
267
- when Test::Unit::Error
268
- detect_file(fault.long_display)
269
- when Test::Unit::Failure
270
- detect_file(fault.location.to_s)
271
- when Spec::Runner::Reporter::Failure
272
- detect_file(fault.exception.backtrace.to_s)
273
- else
274
- example.name
275
- end
276
- end
277
-
278
- def current_error(fault = current_failure)
279
- case fault
280
- when nil
281
- nil
282
- when Test::Unit::Failure
283
- Buildr::TestFramework::TestResult::Error.new(fault.message, fault.location)
284
- when Test::Unit::Error
285
- if fault.exception.is_a?(NativeException)
286
- exception = fault.exception.cause
287
- bt = exception.stack_trace.to_a
288
- else
289
- exception = fault.exception
290
- bt = exception.backtrace
291
- end
292
- Buildr::TestFramework::TestResult::Error.new(exception.message, bt)
293
- when Expectations::Results::Error
294
- fault.exception
295
- when Spec::Runner::Reporter::Failure
296
- ex = fault.exception
297
- Buildr::TestFramework::TestResult::Error.new(ex.message, ex.backtrace)
298
- when Expectations::Results
299
- file = fault.file
300
- line = fault.line
301
- Buildr::TestFramework::TestResult::Error.new(fault.message, ["#{fault.file}:#{fault.line}"])
302
- else
303
- if fault.respond_to?(:test_header)
304
- fault.test_header[/\((.+)\)/]
305
- test_cls, test_meth = $1.to_s, $`.to_s
306
- exception = fault.exception
307
- (class << exception; self; end).module_eval do
308
- define_method(:backtrace) do
309
- (["#{test_cls}:in `#{test_meth}'"] + stackTrace).map { |s| s.to_s }
310
- end
311
- end
312
- exception
313
- elsif fault.respond_to?(:method)
314
- test_cls, test_meth = fault.method.test_class.name, fault.method.method_name
315
- exception = fault.throwable
316
- (class << exception; self; end).module_eval do
317
- define_method(:backtrace) do
318
- (["#{test_cls}:in `#{test_meth}'"] + stackTrace).map { |s| s.to_s }
319
- end
320
- end
321
- exception
322
- else
323
- raise "Cannot handle fault #{fault.class}: #{fault.inspect}"
324
- end
325
- end
326
- end
327
-
328
- end # ResultHandler
329
- end
330
- end
331
-
@@ -1,116 +0,0 @@
1
- # Licensed to the Apache Software Foundation (ASF) under one or more
2
- # contributor license agreements. See the NOTICE file distributed with this
3
- # work for additional information regarding copyright ownership. The ASF
4
- # licenses this file to you under the Apache License, Version 2.0 (the
5
- # "License"); you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
9
- #
10
- # Unless required by applicable law or agreed to in writing, software
11
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13
- # License for the specific language governing permissions and limitations under
14
- # the License.
15
-
16
- # ___ ___ _ _ ___ _____ ___ ___ ___ _____ _____ _ _ ___ ___
17
- # | \ / _ \ | \| |/ _ \_ _| | __| \_ _|_ _| |_ _| || |_ _/ __|
18
- # | |) | (_) | | .` | (_) || | | _|| |) | | | | | | | __ || |\__ \
19
- # |___/ \___/ |_|\_|\___/ |_| |___|___/___| |_| |_| |_||_|___|___/
20
- #
21
- # ___ ___ _ ___
22
- # | __|_ _| | | __| CHANGES TO THIS FILE WILL BE LOST
23
- # | _| | || |__| _| AUTO-GENERATED BY BUILDR on <%= Time.now %>
24
- # |_| |___|____|___| PREFER TO EDIT JtestR CONFIGURATION FILE:
25
- #
26
- # <%= user_config %>
27
-
28
- begin
29
- <%= jruby_gem %>
30
- <%= dependencies.map(&:to_s).inspect %>.each { |dep| $CLASSPATH << dep }
31
- <%= runner.gems.inspect %>.each { |ary| JRuby.gem(*ary.flatten) }
32
- <%= runner.requires.inspect %>.each { |rb| Kernel.require rb }
33
-
34
- jtestr = JtestR::TestRunner.new
35
-
36
- class << jtestr
37
- def config(&block)
38
- @config_blocks ||= []
39
- @config_blocks << block if block
40
- @config_blocks
41
- end
42
-
43
- def load_configuration
44
- super
45
- config.each { |block| @configuration.instance_eval(&block) }
46
- end
47
- end
48
-
49
- jtestr.config do
50
- classpath [] # already loaded
51
- add_common_classpath false
52
-
53
- <% ts = ( @jtestr_tests[:junit] & tests ).map { |c| 'Java.' + c } %>
54
- junit [<%= ts.join(', ') %>]
55
-
56
- <% ts = ( @jtestr_tests[:testng] & tests ).map { |c| 'Java.' + c } %>
57
- testng [<%= ts.join(', ') %>]
58
-
59
- <% ts = @jtestr_tests[:testunit] & tests %>
60
- test_unit <%= ts.inspect %>
61
-
62
- <% ts = @jtestr_tests[:story] & tests %>
63
- story <%= ts.inspect %>
64
-
65
- <% ts = @jtestr_tests[:rspec] & tests %>
66
- rspec <%= ts.inspect %>
67
-
68
- <% ts = @jtestr_tests[:expect] & tests %>
69
- expectations <%= ts.inspect %>
70
-
71
- ignore __FILE__
72
-
73
- if File.file?(<%= user_config.inspect %>)
74
- ignore <%= user_config.inspect %>
75
- load <%= user_config.inspect %>
76
- end
77
- end # config
78
-
79
- fake_out = StringIO.new
80
-
81
- <% if runner.output == false %>
82
- output = fake_out
83
- <% elsif runner.output.kind_of?(String) %>
84
- output = File.open(<%= result.output.inspect %>, 'w')
85
- <% else %>
86
- output = STDOUT
87
- <% end %>
88
-
89
- args = [ '<%= spec_dir %>', # the directory to search for jtestr files
90
- JtestR::SimpleLogger::ERR, # log level (DEBUG/WARN/ERR)
91
- JtestR::GenericResultHandler::QUIET, #output level (QUIET/VERBOSE)
92
- fake_out, # output STDOUT
93
- [], # groups to run
94
- # Use JtestR::GenericResultHandler for debugging
95
- Buildr::JtestR::ResultHandler, # result handler
96
- [] # classpath
97
- ]
98
-
99
- argv = <%= runner.rspec.inspect %> || []
100
- argv.push *<%= tests.inspect %>
101
- Buildr::JtestR::ResultHandler.init(argv, output, output)
102
- Buildr::JtestR::ResultHandler.test_files = <%= tests.inspect %>
103
-
104
- jtestr.run *args
105
-
106
- rescue => e
107
- Buildr::TestFramework::TestResult::Error.dump_yaml('<%= runner.result %>', e) rescue \
108
- puts "-[--- ERROR ---]-", e.class, e.message, *e.backtrace
109
- end
110
-
111
- exit 0 # let buildr find the errors from the result yaml
112
-
113
- # Local Variables:
114
- # mode: ruby
115
- # End:
116
-