Permalink
Browse files

Build and test with only 1.8 or 1.9 mode enabled.

Closes #1558. Closes #1560.
  • Loading branch information...
1 parent 8d30323 commit ccaa71730676587c7e16b76ca10a2db1f82169bf @brixen brixen committed Feb 17, 2012
Showing with 23 additions and 16 deletions.
  1. +1 −1 Rakefile
  2. +1 −0 configure
  3. +12 −10 spec/command_line/dash_x_version_spec.rb
  4. +1 −3 vm/capi/module.cpp
  5. +8 −2 vm/test/test_fixnum.hpp
View
@@ -217,7 +217,7 @@ task :spec20 => %w[build vm:test] do
end
desc "Run CI in default (configured) mode but do not rebuild on failure"
-task :spec => %w[spec18 spec19]
+task :spec => BUILD_CONFIG[:version_list].map { |v| "spec#{v}" }
desc "Print list of items marked to-do in kernel/ (@todo|TODO)"
task :todos do
View
@@ -199,6 +199,7 @@ class Configure
o.on "--enable-version", "VERSION", "Enable Ruby VERSION support (eg 18,19)" do |v|
@version_list = normalize_versions v
+ @default_version = @version_list.first if @version_list.size == 1
end
o.doc "\n Compiler settings"
@@ -1,19 +1,21 @@
require File.expand_path('../../spec_helper', __FILE__)
describe "The -Xversion command line option" do
-
- describe "-X18" do
- it "sets RUBY_VERSION to 1.8.7 when RBXOPT specifies 1.9.3" do
- opts = { :args => %Q{-e "puts RUBY_VERSION" 2>&1}, :env => { "RBXOPT" => "-X19" }, :options => "-X18" }
- ruby_exe(nil, opts).chomp.should == "1.8.7"
+ ruby_version_is ""..."1.9" do
+ describe "-X18" do
+ it "sets RUBY_VERSION to 1.8.7 when RBXOPT specifies 1.9.3" do
+ opts = { :args => %Q{-e "puts RUBY_VERSION" 2>&1}, :env => { "RBXOPT" => "-X19" }, :options => "-X18" }
+ ruby_exe(nil, opts).chomp.should == "1.8.7"
+ end
end
end
- describe "-X19" do
- it "sets RUBY_VERSION to 1.9.3 when RBXOPT specifies 1.8.7" do
- opts = { :args => %Q{-e "puts RUBY_VERSION" 2>&1}, :env => { "RBXOPT" => "-X18" }, :options => "-X19" }
- ruby_exe(nil, opts).chomp.should == "1.9.3"
+ ruby_version_is "1.9" do
+ describe "-X19" do
+ it "sets RUBY_VERSION to 1.9.3 when RBXOPT specifies 1.8.7" do
+ opts = { :args => %Q{-e "puts RUBY_VERSION" 2>&1}, :env => { "RBXOPT" => "-X18" }, :options => "-X19" }
+ ruby_exe(nil, opts).chomp.should == "1.9.3"
+ end
end
end
-
end
View
@@ -30,9 +30,7 @@ extern "C" {
}
int rb_const_defined_at(VALUE module_handle, ID const_id) {
- NativeMethodEnvironment* env = NativeMethodEnvironment::get();
-
- if(LANGUAGE_18_ENABLED(env->state())) {
+ if(LANGUAGE_18_ENABLED(NativeMethodEnvironment::get()->state())) {
return rb_funcall(module_handle,
rb_intern("const_defined?"), 1, ID2SYM(const_id));
} else {
View
@@ -1,5 +1,6 @@
#include "vm/test/test.hpp"
+#include "configuration.hpp"
#include "builtin/exception.hpp"
#include "builtin/list.hpp"
@@ -315,8 +316,13 @@ class TestFixnum : public CxxTest::TestSuite, public VMTest {
TS_ASSERT_EQUALS(Fixnum::from(-1)->pow(state, Fixnum::from(1)), Fixnum::from(-1));
TS_ASSERT_EQUALS(Fixnum::from(-1)->pow(state, Fixnum::from(2)), Fixnum::from(1));
TS_ASSERT_EQUALS(Fixnum::from(7)->pow(state, Fixnum::from(5)), Fixnum::from(16807));
- check_float(as<Float>(Fixnum::from(100)->pow(state, Fixnum::from(-1))),
- Float::create(state,.01));
+ }
+
+ void test_pow_with_float() {
+ if(LANGUAGE_18_ENABLED(state)) {
+ check_float(as<Float>(Fixnum::from(100)->pow(state, Fixnum::from(-1))),
+ Float::create(state,.01));
+ }
}
void test_pow_overflows_to_bignum() {

0 comments on commit ccaa717

Please sign in to comment.