Support verbose mode in bintest.
MODIFY
lib/mruby/build.rb
lib/mruby/build.rb
@@ -293,10 +293,14 @@ EOS
@build_mrbtest_lib_only
end
+ def verbose_flag
+ $verbose ? ' -v' : ''
+ end
+
def run_test
puts ">>> Test #{name} <<<"
mrbtest = exefile("#{build_dir}/bin/mrbtest")
- sh "#{filename mrbtest.relative_path}#{$verbose ? ' -v' : ''}"
+ sh "#{filename mrbtest.relative_path}#{verbose_flag}"
puts
run_bintest if bintest_enabled?
end
@@ -304,7 +308,7 @@ EOS
def run_bintest
targets = @gems.select { |v| File.directory? "#{v.dir}/bintest" }.map { |v| filename v.dir }
targets << filename(".") if File.directory? "./bintest"
- sh "ruby test/bintest.rb #{targets.join ' '}"
+ sh "ruby test/bintest.rb#{verbose_flag} #{targets.join ' '}"
end
def print_build_summary

MODIFY
test/bintest.rb
test/bintest.rb
@@ -20,6 +20,10 @@ def shellquote(s)
end
ARGV.each do |gem|
+ case gem
+ when '-v'; $mrbtest_verbose = true
+ end
+
case RbConfig::CONFIG['host_os']
when /mswin(?!ce)|mingw|bccwin/
gem = gem.gsub('\\', '/')

Support verbose mode in bintest.