summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Rakefile23
-rw-r--r--lib/mruby/gem.rb2
-rw-r--r--test/assert.rb4
-rw-r--r--test/bintest.rb3
4 files changed, 17 insertions, 15 deletions
diff --git a/Rakefile b/Rakefile
index 6c160a5ed..533153290 100644
--- a/Rakefile
+++ b/Rakefile
@@ -123,20 +123,21 @@ end
desc "run all mruby tests"
task :test
MRuby.each_target do
- next unless test_enabled?
-
- t = :"test_#{self.name}"
- task t => ["all"] do
- run_test
+ if test_enabled?
+ t = :"test_#{self.name}"
+ task t => ["all"] do
+ run_test
+ end
+ task :test => t
end
- task :test => t
- next unless bintest_enabled?
- t = :"bintest_#{self.name}"
- task t => ["all"] do
- run_bintest
+ if bintest_enabled?
+ t = :"bintest_#{self.name}"
+ task t => ["all"] do
+ run_bintest
+ end
+ task :test => t
end
- task :test => t
end
desc "clean all built and in-repo installed artifacts"
diff --git a/lib/mruby/gem.rb b/lib/mruby/gem.rb
index 33396803a..ce2e01ab1 100644
--- a/lib/mruby/gem.rb
+++ b/lib/mruby/gem.rb
@@ -112,7 +112,7 @@ module MRuby
end
def add_test_dependency(*args)
- add_dependency(*args) if build.test_enabled?
+ add_dependency(*args) if build.test_enabled? || build.bintest_enabled?
end
def add_conflict(name, *req)
diff --git a/test/assert.rb b/test/assert.rb
index 8a723762e..623ec9138 100644
--- a/test/assert.rb
+++ b/test/assert.rb
@@ -22,9 +22,7 @@ def assertion_string(err, str, iso=nil, e=nil, bt=nil)
msg = "#{err}#{str}"
msg += " [#{iso}]" if iso && !iso.empty?
msg += " => #{e}" if e && !e.to_s.empty?
- if Object.const_defined?(:GEMNAME)
- msg += " (#{GEMNAME == 'mruby-test' ? 'core' : "mrbgems: #{GEMNAME}"})"
- end
+ msg += " (#{GEMNAME == 'mruby-test' ? 'core' : "mrbgems: #{GEMNAME}"})"
if $mrbtest_assert && $mrbtest_assert.size > 0
$mrbtest_assert.each do |idx, assert_msg, diff|
msg += "\n - Assertion[#{idx}] Failed: #{assert_msg}\n#{diff}"
diff --git a/test/bintest.rb b/test/bintest.rb
index b62419d44..d0126cfa0 100644
--- a/test/bintest.rb
+++ b/test/bintest.rb
@@ -1,6 +1,8 @@
$:.unshift File.dirname(File.dirname(File.expand_path(__FILE__)))
require 'test/assert.rb'
+GEMNAME = ""
+
def cmd(s)
case RbConfig::CONFIG['host_os']
when /mswin(?!ce)|mingw|bccwin/
@@ -30,6 +32,7 @@ ARGV.each do |gem|
end
Dir["#{gem}/bintest/**/*.rb"].each do |file|
+ GEMNAME.replace(File.basename(gem))
load file
end
end