From fa5c3d4f517ef5859a0755ca4caeb680240fd060 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Mon, 3 Mar 2014 16:58:27 +0900 Subject: add test to check striped binary works correctly --- mrbgems/mruby-bin-strip/bintest/mruby-strip.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'mrbgems') 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 -- cgit v1.2.3 From 24e3e33cb654cd54aca76acb5390852b8b913bb9 Mon Sep 17 00:00:00 2001 From: take_cheeze Date: Mon, 3 Mar 2014 17:01:47 +0900 Subject: use tempfile module --- mrbgems/mruby-bin-mruby/bintest/mruby.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'mrbgems') 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 -- cgit v1.2.3