Skip to content

versionize vm:test #1560

Closed
wants to merge 1 commit into from
View
12 Rakefile
@@ -139,19 +139,19 @@ end
# These tasks run the specs in the specified mode regardless of
# the default mode with which Rubinius was configured.
desc "Run CI in 1.8 mode"
-task :ci18 => %w[build vm:test] do
+task :ci18 => %w[build vm:test18] do
ENV['CI_MODE_FLAG'] = "-T -X18"
run_ci
end
desc "Run CI in 1.9 mode"
-task :ci19 => %w[build vm:test] do
+task :ci19 => %w[build vm:test19] do
ENV['CI_MODE_FLAG'] = "-T -X19"
run_ci
end
desc "Run CI in 2.0 mode"
-task :ci20 => %w[build vm:test] do
+task :ci20 => %w[build vm:test20] do
ENV['CI_MODE_FLAG'] = "-T -X20"
run_ci
end
@@ -202,17 +202,17 @@ task :docs do
end
desc "Run the CI specs in 1.8 mode but do not rebuild on failure"
-task :spec18 => %w[build vm:test] do
+task :spec18 => %w[build vm:test18] do
run_specs "-T -X18"
end
desc "Run the CI specs in 1.9 mode but do not rebuild on failure"
-task :spec19 => %w[build vm:test] do
+task :spec19 => %w[build vm:test19] do
run_specs "-T -X19"
end
desc "Run the CI specs in 2.0 mode but do not rebuild on failure"
-task :spec20 => %w[build vm:test] do
+task :spec20 => %w[build vm:test20] do
run_specs "-T -X20"
end
View
21 rakelib/vm.rake
@@ -301,13 +301,30 @@ file "web/_includes/instructions.markdown" => insn_deps do |t|
end
namespace :vm do
- desc 'Run all VM tests. Uses its argument as a filter of tests to run.'
- task :test, :filter do |task, args|
+ def run_test(args)
ENV['SUITE'] = args[:filter] if args[:filter]
+ ENV['TEST_MODE'] = args[:test_mode] if args[:test_mode]
ENV['VERBOSE'] = '1' if $verbose
sh 'vm/test/runner', :verbose => $verbose
end
+ desc 'Run all VM tests. Uses its argument as a filter of tests to run.'
+ task :test, :filter do |task, args|
+ run_test(args)
+ end
+
+ task :test18, :filter do |task, args|
+ run_test({:test_mode => "18"}.merge(args))
+ end
+
+ task :test19, :filter do |task, args|
+ run_test({:test_mode => "19"}.merge(args))
+ end
+
+ task :test20, :filter do |task, args|
+ run_test({:test_mode => "20"}.merge(args))
+ end
+
task :test => %w[ vm/test/runner ]
desc "Clean up vm build files"
View
4 vm/test/test.hpp
@@ -21,6 +21,10 @@ class VMTest {
void create() {
config_parser = new ConfigParser;
+ const char *test_mode = getenv("TEST_MODE");
+ if (test_mode) {
+ config.version.set(test_mode);
+ }
shared = new SharedState(0, config, *config_parser);
VM* vm = shared->new_vm();
vm->initialize_as_root();
Something went wrong with that request. Please try again.