summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-bin-strip
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <[email protected]>2015-09-30 15:42:27 +0900
committerYasuhiro Matsumoto <[email protected]>2015-09-30 16:13:02 +0900
commit545d649eff73021d515f7a96841b363b0001e9d9 (patch)
treee7010366188052a89cc659426fc4bbf55367f7a8 /mrbgems/mruby-bin-strip
parent81ec5f5dc04a45d869ebf393d818cb8d08e0ffbf (diff)
downloadmruby-545d649eff73021d515f7a96841b363b0001e9d9.tar.gz
mruby-545d649eff73021d515f7a96841b363b0001e9d9.zip
fix tests on windows.
'bin/mruby' not work on windows. so correct command name and quoted arguments.
Diffstat (limited to 'mrbgems/mruby-bin-strip')
-rw-r--r--mrbgems/mruby-bin-strip/bintest/mruby-strip.rb32
1 files changed, 16 insertions, 16 deletions
diff --git a/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb b/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb
index e74a74f10..bb664a2b1 100644
--- a/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb
+++ b/mrbgems/mruby-bin-strip/bintest/mruby-strip.rb
@@ -1,13 +1,13 @@
require 'tempfile'
assert('no files') do
- o = `bin/mruby-strip 2>&1`
+ o = `#{cmd('mruby-strip')} 2>&1`
assert_equal 1, $?.exitstatus
assert_equal "no files to strip", o.split("\n")[0]
end
assert('file not found') do
- o = `bin/mruby-strip not_found.mrb 2>&1`
+ o = `#{cmd('mruby-strip')} not_found.mrb 2>&1`
assert_equal 1, $?.exitstatus
assert_equal "can't open file for reading not_found.mrb\n", o
end
@@ -16,7 +16,7 @@ assert('not irep file') do
t = Tempfile.new('script.rb')
t.write 'p test\n'
t.flush
- o = `bin/mruby-strip #{t.path} 2>&1`
+ o = `#{cmd('mruby-strip')} #{t.path} 2>&1`
assert_equal 1, $?.exitstatus
assert_equal "can't read irep file #{t.path}\n", o
end
@@ -26,15 +26,15 @@ assert('success') do
Tempfile.new('script.rb'), Tempfile.new('c1.mrb'), Tempfile.new('c2.mrb')
script_file.write "p 'test'\n"
script_file.flush
- `bin/mrbc -g -o #{compiled1.path} #{script_file.path}`
- `bin/mrbc -g -o #{compiled2.path} #{script_file.path}`
+ `#{cmd('mrbc')} -g -o #{compiled1.path} #{script_file.path}`
+ `#{cmd('mrbc')} -g -o #{compiled2.path} #{script_file.path}`
- o = `bin/mruby-strip #{compiled1.path}`
+ o = `#{cmd('mruby-strip')} #{compiled1.path}`
assert_equal 0, $?.exitstatus
assert_equal "", o
- assert_equal `bin/mruby #{script_file.path}`, `bin/mruby -b #{compiled1.path}`
+ assert_equal `#{cmd('mruby')} #{script_file.path}`, `#{cmd('mruby')} -b #{compiled1.path}`
- o = `bin/mruby-strip #{compiled1.path} #{compiled2.path}`
+ o = `#{cmd('mruby-strip')} #{compiled1.path} #{compiled2.path}`
assert_equal 0, $?.exitstatus
assert_equal "", o
end
@@ -44,12 +44,12 @@ assert('check debug section') do
Tempfile.new('script.rb'), Tempfile.new('c1.mrb'), Tempfile.new('c2.mrb')
script_file.write "p 'test'\n"
script_file.flush
- `bin/mrbc -o #{without_debug.path} #{script_file.path}`
- `bin/mrbc -g -o #{with_debug.path} #{script_file.path}`
+ `#{cmd('mrbc')} -o #{without_debug.path} #{script_file.path}`
+ `#{cmd('mrbc')} -g -o #{with_debug.path} #{script_file.path}`
assert_true with_debug.size >= without_debug.size
- `bin/mruby-strip #{with_debug.path}`
+ `#{cmd('mruby-strip')} #{with_debug.path}`
assert_equal without_debug.size, with_debug.size
end
@@ -62,12 +62,12 @@ a += b
p Kernel.local_variables
EOS
script_file.flush
- `bin/mrbc -o #{with_lv.path} #{script_file.path}`
- `bin/mrbc -o #{without_lv.path} #{script_file.path}`
+ `#{cmd('mrbc')} -o #{with_lv.path} #{script_file.path}`
+ `#{cmd('mrbc')} -o #{without_lv.path} #{script_file.path}`
- `bin/mruby-strip -l #{without_lv.path}`
+ `#{cmd('mruby-strip')} -l #{without_lv.path}`
assert_true without_lv.size < with_lv.size
- assert_equal '[:a, :b]', `bin/mruby -b #{with_lv.path}`.chomp
- assert_equal '[]', `bin/mruby -b #{without_lv.path}`.chomp
+ assert_equal '[:a, :b]', `#{cmd('mruby')} -b #{with_lv.path}`.chomp
+ assert_equal '[]', `#{cmd('mruby')} -b #{without_lv.path}`.chomp
end