Permalink
Browse files

Fix spec runs to keep matching version in parent/child processes.

  • Loading branch information...
1 parent 7f96444 commit f52b1ed209187684f48932e64366046c7bf6e3b8 @headius headius committed Jul 24, 2012
Showing with 27 additions and 16 deletions.
  1. +8 −3 rakelib/commands.rake
  2. +13 −13 rakelib/spec.rake
  3. +3 −0 spec/jruby.1.8.mspec
  4. +3 −0 spec/jruby.1.9.mspec
View
@@ -80,7 +80,7 @@ def mspec(mspec_options = {}, java_options = {}, &code)
mspec_options[:objectspace_enabled] ||= true
mspec_options[:thread_pooling] ||= false
mspec_options[:reflection] ||= false
- mspec_options[:compat] ||= "RUBY1_8"
+ mspec_options[:compat] ||= "1.8"
ms = mspec_options
# We can check this property to see whether we failed the run or not
@@ -96,7 +96,12 @@ def mspec(mspec_options = {}, java_options = {}, &code)
env :key => "JAVA_OPTS", :value => "-Demma.verbosity.level=silent"
env :key => "JRUBY_OPTS", :value => ""
- arg :line => "--1.8" # we launch mspec in 1.8 mode due to oddities in loading .mspec files
+ # launch in the same mode we're testing, since config is loaded by top process
+ arg :line => "--#{ms[:compat]}"
+
+ # if 1.9 mode, add . to load path so mspec config is found
+ arg :line => "-I ." if ms[:compat] == '1.9'
+
arg :line => "#{MSPEC_BIN} ci"
arg :line => "-T -J-ea"
arg :line => "-T -J-Djruby.launch.inproc=false"
@@ -106,7 +111,7 @@ def mspec(mspec_options = {}, java_options = {}, &code)
arg :line => "-T -J-Djruby.objectspace.enabled=#{ms[:objectspace_enabled]}"
arg :line => "-T -J-Djruby.thread.pool.enabled=#{ms[:thread_pooling]}"
arg :line => "-T -J-Djruby.reflection=#{ms[:reflection]}"
- arg :line => "-T -J-Djruby.compat.version=#{ms[:compat]}"
+ arg :line => "-T --#{ms[:compat]}"
arg :line => "-T -J-Demma.coverage.out.file=#{TEST_RESULTS_DIR}/coverage.emma"
arg :line => "-T -J-Demma.coverage.out.merge=true"
arg :line => "-T -J-Demma.verbosity.level=silent"
View
@@ -97,78 +97,78 @@ namespace :spec do
desc "Tagged 1.8 specs in interpreted mode only"
task :interpreted_18 do
mspec :compile_mode => "OFF", :spec_config => RUBY18_MSPEC_FILE,
- :compat => "RUBY1_8"
+ :compat => "1.8"
end
desc "Tagged 1.8 specs in interpreted (IR) mode only"
task :interpreted_ir_18 do
mspec :compile_mode => "OFFIR", :spec_config => RUBY18_MSPEC_FILE,
- :compat => "RUBY1_8"
+ :compat => "1.8"
end
desc "Tagged 1.8 specs in JIT mode only (threshold=0)"
task :compiled_18 do
mspec :compile_mode => "JIT", :spec_config => RUBY18_MSPEC_FILE,
:jit_threshold => 0,
- :compat => "RUBY1_8"
+ :compat => "1.8"
end
desc "Tagged 1.8 specs in AOT mode only"
task :precompiled_18 do
mspec :compile_mode => "FORCE", :spec_config => RUBY18_MSPEC_FILE,
:jit_threshold => 0,
- :compat => "RUBY1_8"
+ :compat => "1.8"
end
desc "All 1.8 specs in interpreted mode only"
task :all_interpreted_18 do
mspec :compile_mode => "OFF",
- :compat => "RUBY1_8"
+ :compat => "1.8"
end
desc "All 1.8 specs in JIT mode only (threshold=0)"
task :all_compiled_18 do
mspec :compile_mode => "JIT", :jit_threshold => 0,
- :compat => "RUBY1_8"
+ :compat => "1.8"
end
desc "All 1.8 specs in AOT mode only"
task :all_precompiled_18 do
mspec :compile_mode => "FORCE", :jit_threshold => 0,
- :compat => "RUBY1_8"
+ :compat => "1.8"
end
desc "Tagged 1.9 specs in interpreted mode only"
task :interpreted_19 do
mspec :compile_mode => "OFF", :spec_config => RUBY19_MSPEC_FILE,
- :compat => "RUBY1_9"
+ :compat => "1.9"
end
desc "Tagged 1.9 specs in JIT mode only (threshold=0)"
task :compiled_19 do
mspec :compile_mode => "JIT", :spec_config => RUBY19_MSPEC_FILE,
- :jit_threshold => 0, :compat => "RUBY1_9"
+ :jit_threshold => 0, :compat => "1.9"
end
desc "Tagged 1.9 specs in AOT mode only"
task :precompiled_19 do
mspec :compile_mode => "FORCE", :spec_config => RUBY19_MSPEC_FILE,
- :jit_threshold => 0, :compat => "RUBY1_9"
+ :jit_threshold => 0, :compat => "1.9"
end
desc "All 1.9 specs in interpreted mode only"
task :all_interpreted_19 do
- mspec :compile_mode => "OFF", :compat => "RUBY1_9"
+ mspec :compile_mode => "OFF", :compat => "1.9"
end
desc "All 1.9 specs in JIT mode only (threshold=0)"
task :all_compiled_19 do
- mspec :compile_mode => "JIT", :jit_threshold => 0, :compat => "RUBY1_9"
+ mspec :compile_mode => "JIT", :jit_threshold => 0, :compat => "1.9"
end
desc "All 1.9 specs in AOT mode only"
task :all_precompiled_19 do
- mspec :compile_mode => "FORCE", :jit_threshold => 0, :compat => "RUBY1_9"
+ mspec :compile_mode => "FORCE", :jit_threshold => 0, :compat => "1.9"
end
# Put Rake on the load path for JI specs without requiring rubygems
View
@@ -11,6 +11,9 @@ WINDOWS = RbConfig::CONFIG['host_os'] =~ /mswin/
SPEC_DIR = File.join(File.dirname(__FILE__), 'ruby') unless defined?(SPEC_DIR)
TAGS_DIR = File.join(File.dirname(__FILE__), 'tags') unless defined?(TAGS_DIR)
+# update env to force children into proper mode
+ENV['JRUBY_OPTS'] = ENV['JRUBY_OPTS'].to_s + " --1.8"
+
class MSpecScript
# Language features specs
set :language, [ SPEC_DIR + '/language' ]
View
@@ -11,6 +11,9 @@ WINDOWS = RbConfig::CONFIG['host_os'] =~ /mswin/
SPEC_DIR = File.join(File.dirname(__FILE__), 'ruby') unless defined?(SPEC_DIR)
TAGS_DIR = File.join(File.dirname(__FILE__), 'tags') unless defined?(TAGS_DIR)
+# update env to force children into proper mode
+ENV['JRUBY_OPTS'] = ENV['JRUBY_OPTS'].to_s + " --1.9"
+
class MSpecScript
# Language features specs
set :language, [

0 comments on commit f52b1ed

Please sign in to comment.