summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/mruby/build.rb17
-rw-r--r--lib/mruby/build/command.rb5
2 files changed, 22 insertions, 0 deletions
diff --git a/lib/mruby/build.rb b/lib/mruby/build.rb
index 67267ab46..66005a6df 100644
--- a/lib/mruby/build.rb
+++ b/lib/mruby/build.rb
@@ -541,6 +541,23 @@ EOS
end
end
+ def run_bintest
+ puts ">>> Bintest #{name} <<<"
+ targets = @gems.select { |v| File.directory? "#{v.dir}/bintest" }.map { |v| filename v.dir }
+ targets << filename(".") if File.directory? "./bintest"
+ mrbc = @gems["mruby-bin-mrbc"] ? exefile("#{@build_dir}/bin/mrbc") : mrbcfile
+
+ emulator = @test_runner.command
+ emulator = @test_runner.shellquote(emulator) if emulator
+
+ env = {
+ "BUILD_DIR" => @build_dir,
+ "MRBCFILE" => mrbc,
+ "EMULATOR" => @test_runner.emulator,
+ }
+ sh env, "ruby test/bintest.rb#{verbose_flag} #{targets.join ' '}"
+ end
+
protected
def create_mrbc_build; end
diff --git a/lib/mruby/build/command.rb b/lib/mruby/build/command.rb
index c93d08ea7..31a595ef0 100644
--- a/lib/mruby/build/command.rb
+++ b/lib/mruby/build/command.rb
@@ -363,6 +363,11 @@ module MRuby
@flags = []
end
+ def emulator
+ return "" unless @command
+ return [@command, *@flags].map{|c| shellquote(c)}.join(' ')
+ end
+
def run(testbinfile)
puts "TEST for " + @build.name
_run runner_options, { :flags => [flags, verbose_flag].flatten.join(' '), :infile => testbinfile }