Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 280 lines (225 sloc) 10.158 kB
e17306b @enebo Ok specs in rakefile?
enebo authored
1 # Definitions:
2 # MSPEC_FILE:
3 # tagged - runs specs which a MSPEC_FILE
4 # all - runs specs without specifying an MSPEC_FILE
5 # !all,!tagged - runs specs with an MSPEC_FILE
6 # RUNTIME:
7 # interpreted - -X-C (or OFF)
8 # compiled - JIT w/ threshold 0
9 # precompiled - AOT (or FORCE)
10 # RUBYSPEC:
11 # latest - grab head of rubyspecs
7c20070 @enebo JRUBY-4711: ant-dist does not include rubyspecs.version in source dis…
enebo authored
12 # stable - get saved blessed version (see RUBYSPECS_VERSION)
e17306b @enebo Ok specs in rakefile?
enebo authored
13
14 # FIXME: Make Rubyspecs FAILED message appear?
15
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
16 namespace :spec do
e17306b @enebo Ok specs in rakefile?
enebo authored
17 # This set of tasks will run ci and retrieve the proper version of specs.
18 # The specs below this section will run specs, but they will not retrieve
19 # the specs they run against. This is so we can run the similiar mspec
20 # runs against a stable and head version of the rubyspecs.
21
0e569d5 @enebo Add spec:short since it is what our fingers want to type
enebo authored
22 desc "Run simple set of tests over both 1.8 and 1.9 modes"
23 task :short => 'spec:ci_interpreted_18_19'
24
e17306b @enebo Ok specs in rakefile?
enebo authored
25 desc "Run rubyspecs expected to pass (version-frozen)"
26 task :ci => ['spec:fetch_stable_specs', 'spec:tagged_18']
27 task :ci_18 => :ci
28
29 desc "Run rubyspecs expected to pass (version-frozen)"
30 task :ci_19 => ['spec:fetch_stable_specs', 'spec:tagged_19']
31
e7f943b @nicksieger Add ci_compiled_18 and ci_precompiled_18 tasks
nicksieger authored
32 desc "Run rubyspecs expected to pass in interpreted mode (version-frozen)"
e17306b @enebo Ok specs in rakefile?
enebo authored
33 task :ci_interpreted_18 => ['spec:fetch_stable_specs', 'spec:interpreted_18']
34
e7f943b @nicksieger Add ci_compiled_18 and ci_precompiled_18 tasks
nicksieger authored
35 desc "Run rubyspecs expected to pass in interpreted 1.9 mode (version-frozen)"
e17306b @enebo Ok specs in rakefile?
enebo authored
36 task :ci_interpreted_19 => ['spec:fetch_stable_specs', 'spec:interpreted_19']
37
e7f943b @nicksieger Add ci_compiled_18 and ci_precompiled_18 tasks
nicksieger authored
38 desc "Run rubyspecs expected to pass in compiled mode (version-frozen)"
11e1bac @nicksieger One more boo-boo on spec task names (compiled only for 1.8 tasks)
nicksieger authored
39 task :ci_compiled_18 => ['spec:fetch_stable_specs', 'spec:compiled_18']
e7f943b @nicksieger Add ci_compiled_18 and ci_precompiled_18 tasks
nicksieger authored
40
41 desc "Run rubyspecs expected to pass in precompiled mode (version-frozen)"
11e1bac @nicksieger One more boo-boo on spec task names (compiled only for 1.8 tasks)
nicksieger authored
42 task :ci_precompiled_18 => ['spec:fetch_stable_specs', 'spec:precompiled_18']
e7f943b @nicksieger Add ci_compiled_18 and ci_precompiled_18 tasks
nicksieger authored
43
44 desc "Run rubyspecs expected to pass in interpreted mode (version-frozen, both 1.8 and 1.9)"
e17306b @enebo Ok specs in rakefile?
enebo authored
45 task :ci_interpreted_18_19 => ['spec:fetch_stable_specs', 'spec:interpreted_18', 'spec:interpreted_19']
46
47 desc "Run all the specs including failures (version-frozen)"
48 task :ci_all => ['spec:fetch_stable_specs', 'spec:all_18']
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
49
50 desc "Run all the specs including failures (version-frozen)"
e17306b @enebo Ok specs in rakefile?
enebo authored
51 task :ci_all_19 => ['spec:fetch_stable_specs', 'spec:all_19']
52
494239d @BanzaiMan Fix typos.
BanzaiMan authored
53 desc "Run all the specs in precompiled mode (version-frozen)"
e17306b @enebo Ok specs in rakefile?
enebo authored
54 task :ci_all_precompiled_18 => ['spec:fetch_stable_specs', 'spec:all_precompiled_18']
55
56 desc "Run rubyspecs expected to pass (against latest rubyspec version)"
e856963 @BanzaiMan Fix spec:ci_latest rake tasks, which didn't actually roll specs to th…
BanzaiMan authored
57 task :ci_latest => ['spec:fast_forward_to_rubyspec_head', 'spec:tagged_18']
e17306b @enebo Ok specs in rakefile?
enebo authored
58
d36935a @BanzaiMan Add ci_latest_19 rake task.
BanzaiMan authored
59 desc "Run rubyspecs expected to pass (against latest rubyspec version)"
e856963 @BanzaiMan Fix spec:ci_latest rake tasks, which didn't actually roll specs to th…
BanzaiMan authored
60 task :ci_latest_19 => ['spec:fast_forward_to_rubyspec_head', 'spec:tagged_19']
d36935a @BanzaiMan Add ci_latest_19 rake task.
BanzaiMan authored
61
d448f9e @timfel add tasks and mspec definitions to run cext specs on the CI
timfel authored
62 desc "Run optional C API rubyspecs"
63 task :ci_cext => ['spec:fast_forward_to_rubyspec_head'] do
64 mspec :spec_config => CEXT_MSPEC_FILE
65 fail "One or more Ruby spec runs have failed" if spec_run_error
66 end
67
e17306b @enebo Ok specs in rakefile?
enebo authored
68 # Note: For this point below it is your reponsibility to make sure specs
69 # are checked out.
70
71 desc "Run 1.8 tagged specs in interpreted, JIT, and pre-compiled modes"
72 task :tagged_18 => [:interpreted_18, :compiled_18, :precompiled_18] do
73 fail "One or more Ruby spec runs have failed" if spec_run_error
74 end
75
76 desc "Run all 1.8 specs in interpreted, JIT, and pre-compiled modes"
77 task :all_18 => [:all_interpreted_18, :all_compiled_18, :all_precompiled_18] do
78 fail "One or more Ruby spec runs have failed" if spec_run_error
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
79 end
80
e17306b @enebo Ok specs in rakefile?
enebo authored
81 desc "Run 1.9 tagged specs in interpreted, JIT, and pre-compiled modes"
82 task :tagged_19 => [:interpreted_19, :compiled_19, :precompiled_19] do
83 fail "One or more Ruby spec runs have failed" if spec_run_error
84 end
85
86 desc "Run all 1.9 specs in interpreted, JIT, and pre-compiled modes"
87 task :all_19 => [:all_interpreted_19, :all_compiled_19, :all_precompiled_19] do
88 fail "One or more Ruby spec runs have failed" if spec_run_error
89 end
fdb8933 @enebo Windows safe check?
enebo authored
90
91 desc "Tagged 1.8 specs in interpreted mode only"
e17306b @enebo Ok specs in rakefile?
enebo authored
92 task :interpreted_18 do
fdb8933 @enebo Windows safe check?
enebo authored
93 mspec :compile_mode => "OFF", :spec_config => RUBY18_MSPEC_FILE
94 end
95
96 desc "Tagged 1.8 specs in JIT mode only (threshold=0)"
e17306b @enebo Ok specs in rakefile?
enebo authored
97 task :compiled_18 do
fdb8933 @enebo Windows safe check?
enebo authored
98 mspec :compile_mode => "JIT", :spec_config => RUBY18_MSPEC_FILE,
99 :jit_threshold => 0
100 end
101
102 desc "Tagged 1.8 specs in AOT mode only"
e17306b @enebo Ok specs in rakefile?
enebo authored
103 task :precompiled_18 do
fdb8933 @enebo Windows safe check?
enebo authored
104 mspec :compile_mode => "FORCE", :spec_config => RUBY18_MSPEC_FILE,
105 :jit_threshold => 0
106 end
107
e17306b @enebo Ok specs in rakefile?
enebo authored
108 desc "All 1.8 specs in interpreted mode only"
109 task :all_interpreted_18 do
110 mspec :compile_mode => "OFF"
111 end
112
113 desc "All 1.8 specs in JIT mode only (threshold=0)"
114 task :all_compiled_18 do
115 mspec :compile_mode => "JIT", :jit_threshold => 0
116 end
117
118 desc "All 1.8 specs in AOT mode only"
119 task :all_precompiled_18 do
120 mspec :compile_mode => "FORCE", :jit_threshold => 0
121 end
122
123 desc "Tagged 1.9 specs in interpreted mode only"
124 task :interpreted_19 do
125 mspec :compile_mode => "OFF", :spec_config => RUBY19_MSPEC_FILE,
126 :compat => "RUBY1_9"
127 end
128
129 desc "Tagged 1.9 specs in JIT mode only (threshold=0)"
130 task :compiled_19 do
131 mspec :compile_mode => "JIT", :spec_config => RUBY19_MSPEC_FILE,
132 :jit_threshold => 0, :compat => "RUBY1_9"
133 end
134
135 desc "Tagged 1.9 specs in AOT mode only"
136 task :precompiled_19 do
137 mspec :compile_mode => "FORCE", :spec_config => RUBY19_MSPEC_FILE,
138 :jit_threshold => 0, :compat => "RUBY1_9"
139 end
140
141 desc "All 1.9 specs in interpreted mode only"
142 task :all_interpreted_19 do
143 mspec :compile_mode => "OFF", :compat => "RUBY1_9"
144 end
145
146 desc "All 1.9 specs in JIT mode only (threshold=0)"
147 task :all_compiled_19 do
148 mspec :compile_mode => "JIT", :jit_threshold => 0, :compat => "RUBY1_9"
149 end
150
151 desc "All 1.9 specs in AOT mode only"
152 task :all_precompiled_19 do
153 mspec :compile_mode => "FORCE", :jit_threshold => 0, :compat => "RUBY1_9"
154 end
155
359be59 @nicksieger Fix spec run -- make Rake available to JI specs w/o rubygems
nicksieger authored
156 # Put Rake on the load path for JI specs without requiring rubygems
157 rake_location = File.join(Gem.loaded_specs['rake'].full_gem_path, "lib")
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
158 gem 'rspec'
96a3dd9 @nicksieger Upgrade to RSpec 2 for JRuby dev use.
nicksieger authored
159 require 'rspec/core/rake_task'
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
160
127453f @enebo Allow our internal specs to run in 1.9 mode
enebo authored
161 {"" => "--1.8", "_19" => "--1.9"}.each do |version_suffix, version_arg|
162 desc "Runs Java Integration Specs"
163 RSpec::Core::RakeTask.new("ji#{version_suffix}" => "test:compile") do |t|
164 t.ruby_opts = " -I#{rake_location}"
165 t.ruby_opts = version_arg
166 t.rspec_opts ||= []
167 t.rspec_opts << "--options" << "spec/java_integration/spec.opts"
168 t.pattern = 'spec/java_integration/**/*_spec.rb'
169 end
170
171 desc "Runs Java Integration specs quietly"
172 RSpec::Core::RakeTask.new("ji:quiet#{version_suffix}" => "test:compile") do |t|
173 t.ruby_opts = " -I#{rake_location}"
174 t.ruby_opts = version_arg
175 t.rspec_opts ||= []
176 t.rspec_opts << "--options" << "spec/java_integration/spec.quiet.opts"
177 t.pattern = 'spec/java_integration/**/*_spec.rb'
178 end
179
180 desc "Runs Compiler Specs"
181 RSpec::Core::RakeTask.new("compiler#{version_suffix}" => "test:compile") do |t|
182 t.ruby_opts = version_arg
183 t.pattern = 'spec/compiler/**/*_spec.rb'
184 end
185
186 desc "Runs FFI specs"
187 RSpec::Core::RakeTask.new("ffi#{version_suffix}" => "test:compile") do |t|
188 t.ruby_opts = version_arg
189 t.pattern = 'spec/ffi/**/*_spec.rb'
190 end
191
192 desc "Runs Java Signature Parser Specs"
193 RSpec::Core::RakeTask.new("java_signature_parser#{version_suffix}") do |t|
194 t.ruby_opts = version_arg
195 t.rspec_opts ||= []
196 # t.spec_opts << "--options" << "spec/java_integration/spec.quiet.opts"
197 t.pattern = 'spec/grammar/**/*_spec.rb'
198 end
199
200 desc "Runs Regression Specs"
201 RSpec::Core::RakeTask.new("regression#{version_suffix}") do |t|
202 t.ruby_opts = version_arg
203 t.pattern = 'spec/regression/**/*_spec.rb'
204 end
aeef7dd @enebo Add some simple type specs for java signatures
enebo authored
205
65acec5 @nahi Added 'spec:regression' task and spec for JRUBY-4940.
nahi authored
206 end
207
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
208 # Complimentary tasks for running specs
209
e17306b @enebo Ok specs in rakefile?
enebo authored
210 task :fetch_latest_specs => [:install_build_gems, :fetch_latest_rubyspec_repo, :fetch_latest_mspec_repo]
211
212 task :fetch_stable_specs => :fetch_latest_specs do
213 if stable_specs_changed?
214 puts "Rolling rubyspec to stable version"
7c20070 @enebo JRUBY-4711: ant-dist does not include rubyspecs.version in source dis…
enebo authored
215 git_checkout('rubyspec', RUBYSPECS_REVISION, RUBYSPEC_DIR)
e17306b @enebo Ok specs in rakefile?
enebo authored
216
217 puts "Rolling mspec to stable version"
7c20070 @enebo JRUBY-4711: ant-dist does not include rubyspecs.version in source dis…
enebo authored
218 git_checkout('mspec', MSPEC_REVISION, MSPEC_DIR)
e17306b @enebo Ok specs in rakefile?
enebo authored
219
220 ant.propertyfile(:file => "#{SPEC_DIR}/rubyspecs.current.revision",
221 :comment => "Revision of downloaded specs") do
7c20070 @enebo JRUBY-4711: ant-dist does not include rubyspecs.version in source dis…
enebo authored
222 entry :key => "rubyspecs.current.revision", :value => RUBYSPECS_REVISION
223 entry :key => "mspec.current.revision", :value => MSPEC_REVISION
e17306b @enebo Ok specs in rakefile?
enebo authored
224 end
225 end
226 end
e856963 @BanzaiMan Fix spec:ci_latest rake tasks, which didn't actually roll specs to th…
BanzaiMan authored
227
228 task :fast_forward_to_rubyspec_head => :fetch_latest_specs do
229 puts "Rolling to rubyspec to latest version"
ed41755 @BanzaiMan Check out origin/HEAD first, so that we get the latest spec for sure.
BanzaiMan authored
230 git_checkout('rubyspec', 'origin/HEAD', RUBYSPEC_DIR)
e856963 @BanzaiMan Fix spec:ci_latest rake tasks, which didn't actually roll specs to th…
BanzaiMan authored
231 git_move_to_head_detached('rubyspec', RUBYSPEC_GIT_REPO, RUBYSPEC_DIR)
232 end
c25c8f3 @enebo Move more into Rake from Ant
enebo authored
233
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
234 desc "Retrieve latest tagged rubyspec git repository"
c9a39e8 @enebo Hopefully unbreak spec runs due to globbing of rakefile *.rake files.…
enebo authored
235 task :fetch_latest_rubyspec_repo do
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
236 unless git_repo_exists? RUBYSPEC_DIR
e17306b @enebo Ok specs in rakefile?
enebo authored
237 clean_spec_dirs
2a8097f @vvs Perform full git clone for rubyspec/mspec
vvs authored
238 git_clone('rubyspec', RUBYSPEC_GIT_REPO, RUBYSPEC_DIR)
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
239 else
02eebe0 @BanzaiMan Eschew passing cryptic "true".
BanzaiMan authored
240 git_fetch('rubyspec', RUBYSPEC_DIR, ignore_error = true)
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
241 end
242 end
243
244 desc "Retrieve latest tagged mspec git repository"
245 task :fetch_latest_mspec_repo do
246 unless git_repo_exists? MSPEC_DIR
2a8097f @vvs Perform full git clone for rubyspec/mspec
vvs authored
247 git_clone('mspec', MSPEC_GIT_REPO, MSPEC_DIR)
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
248 else
02eebe0 @BanzaiMan Eschew passing cryptic "true".
BanzaiMan authored
249 git_fetch('mspec', MSPEC_DIR, ignore_error = true)
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
250 end
251 end
252
e17306b @enebo Ok specs in rakefile?
enebo authored
253 desc "Clean up spec dirs"
254 task :clean_specs do
255 clean_spec_dirs(true)
256 end
257
258 def stable_specs_changed?
259 ant.property :file => "${SPEC_DIR}/rubyspecs.current.revision"
260 p = ant.properties
261
262 !File.exists?(RUBYSPEC_DIR) || !File.exists?(MSPEC_DIR) ||
7c20070 @enebo JRUBY-4711: ant-dist does not include rubyspecs.version in source dis…
enebo authored
263 RUBYSPECS_REVISION != p['rubyspecs.current.revision'] ||
264 MSPEC_REVISION != p['mspec.current.revision']
e17306b @enebo Ok specs in rakefile?
enebo authored
265 end
266
267 def clean_spec_dirs(wipe_spec_dir = false)
268 rm_rf RUBYSPEC_DIR if wipe_spec_dir
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
269 rm_rf MSPEC_DIR
270 rm_f RUBYSPEC_TAR_FILE
271 rm_f MSPEC_TAR_FILE
272 rm_f File.join(SPEC_DIR, "rubyspecs.current.revision")
273 end
e17306b @enebo Ok specs in rakefile?
enebo authored
274
275 def spec_run_error
276 # Obtuseriffic - If any previous spec runs were non-zero return we failed
277 ['OFF', 'JIT', 'FORCE'].any? {|n| ant.properties["spec.status.#{n}"] != "0"}
278 end
0104198 @enebo Too many changes to our build...Raking an ant file
enebo authored
279 end
Something went wrong with that request. Please try again.