diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-04 01:39:34 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-03-04 01:39:34 +0900 |
| commit | e1b3cfa88e6043c6b9c21a944e40cc888f02bb0f (patch) | |
| tree | 98cefa503d0886a16db8b456fedf5c3aa56b34f5 | |
| parent | 18f0fcb0c78b22543e60d866eefb8289015758b9 (diff) | |
| parent | 0cc34d64a2d9a6ce33e8bc3e328c02fd788e96dd (diff) | |
| download | mruby-e1b3cfa88e6043c6b9c21a944e40cc888f02bb0f.tar.gz mruby-e1b3cfa88e6043c6b9c21a944e40cc888f02bb0f.zip | |
Merge branch 'master' of github.com:mruby/mruby
| -rw-r--r-- | mrbgems/mruby-bin-mruby/bintest/mruby.rb | 9 | ||||
| -rw-r--r-- | mrbgems/mruby-bin-strip/bintest/mruby-strip.rb | 1 | ||||
| -rw-r--r-- | tasks/mruby_build.rake | 3 | ||||
| -rw-r--r-- | test/bintest.rb | 6 |
4 files changed, 13 insertions, 6 deletions
diff --git a/mrbgems/mruby-bin-mruby/bintest/mruby.rb b/mrbgems/mruby-bin-mruby/bintest/mruby.rb index 2eb41d758..22872c389 100644 --- a/mrbgems/mruby-bin-mruby/bintest/mruby.rb +++ b/mrbgems/mruby-bin-mruby/bintest/mruby.rb @@ -1,3 +1,5 @@ +require 'tempfile' + assert('regression for #1564') do o = `bin/mruby -e '<<' 2>&1` assert_equal o, "-e:1:2: syntax error, unexpected tLSHFT\n" @@ -6,8 +8,9 @@ assert('regression for #1564') do end assert('regression for #1572') do - system "echo 'p \"ok\"' > /tmp/1572.rb" - system "bin/mrbc -g -o /tmp/1572.mrb /tmp/1572.rb" - o = `bin/mruby -b /tmp/1572.mrb`.strip + script, bin = Tempfile.new('test.rb'), Tempfile.new('test.mrb') + system "echo 'p \"ok\"' > #{script.path}" + system "bin/mrbc -g -o #{bin.path} #{script.path}" + o = `bin/mruby -b #{bin.path}`.strip assert_equal o, '"ok"' end diff --git a/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb b/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb index 4f27d2fce..17bd0e71f 100644 --- a/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb +++ b/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb @@ -32,6 +32,7 @@ assert('success') do o = `bin/mruby-strip #{compiled1.path}` assert_equal 0, $?.exitstatus assert_equal "", o + assert_equal `bin/mruby #{script_file.path}`, `bin/mruby -b #{compiled1.path}` o = `bin/mruby-strip #{compiled1.path} #{compiled2.path}` assert_equal 0, $?.exitstatus diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake index c65ad4c20..432100f8d 100644 --- a/tasks/mruby_build.rake +++ b/tasks/mruby_build.rake @@ -194,7 +194,8 @@ module MRuby end def run_bintest - sh "ruby test/bintest.rb" + targets = @gems.select { |v| Dir.exists? "#{v.dir}/bintest" }.map { |v| filename v.dir } + sh "ruby test/bintest.rb #{targets.join ' '}" end def print_build_summary diff --git a/test/bintest.rb b/test/bintest.rb index e9dbb285e..0ff3341a0 100644 --- a/test/bintest.rb +++ b/test/bintest.rb @@ -1,8 +1,10 @@ $:.unshift File.dirname(File.dirname(File.expand_path(__FILE__))) require 'test/assert.rb' -Dir['mrbgems/**/bintest/*.rb'].each do |file| - load file +ARGV.each do |gem| + Dir["#{gem}/bintest/*.rb"].each do |file| + load file + end end load 'test/report.rb' |
