* win32/win32.c (rb_w32_spawn, rb_w32_aspawn): use NULL as

application name for batch files.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2009-03-22 05:51:58 +00:00
parent 5bdeb55a02
commit 6a64e9e4ac
4 changed files with 85 additions and 32 deletions

View file

@ -824,6 +824,15 @@ class TestProcess < Test::Unit::TestCase
assert_match(/\Ataka pid=\d+ ppid=\d+\z/, result1)
assert_match(/\Ataki pid=\d+ ppid=\d+\z/, result2)
assert_not_equal(result1[/\d+/].to_i, status.pid)
if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
Dir.mkdir(path = "path with space")
write_file(bat = path + "/bat test.bat", "@echo %1>out")
system(bat, "foo 'bar'")
assert_equal(%["foo 'bar'"\n], File.read("out"), '[ruby-core:22960]')
system(%[#{bat.dump} "foo 'bar'"])
assert_equal(%["foo 'bar'"\n], File.read("out"), '[ruby-core:22960]')
end
}
end
@ -847,6 +856,23 @@ class TestProcess < Test::Unit::TestCase
assert_match(/\Ataku pid=\d+ ppid=\d+\z/, result1)
assert_match(/\Atake pid=\d+ ppid=\d+\z/, result2)
assert_not_equal(result1[/\d+/].to_i, status.pid)
if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
Dir.mkdir(path = "path with space")
write_file(bat = path + "/bat test.bat", "@echo %1>out")
pid = spawn(bat, "foo 'bar'")
Process.wait pid
status = $?
assert(status.exited?)
assert(status.success?)
assert_equal(%["foo 'bar'"\n], File.read("out"), '[ruby-core:22960]')
pid = spawn(%[#{bat.dump} "foo 'bar'"])
Process.wait pid
status = $?
assert(status.exited?)
assert(status.success?)
assert_equal(%["foo 'bar'"\n], File.read("out"), '[ruby-core:22960]')
end
}
end
@ -871,9 +897,11 @@ class TestProcess < Test::Unit::TestCase
if /mswin|bccwin|mingw/ =~ RUBY_PLATFORM
Dir.mkdir(path = "path with space")
write_file(bat = path + "/battest.bat", "@echo %1")
write_file(bat = path + "/bat test.bat", "@echo %1")
r = IO.popen([bat, "foo 'bar'"]) {|f| f.read}
assert_equal(%["foo 'bar'"\n], r, '[ruby-core:22960]')
r = IO.popen(%[#{bat.dump} "foo 'bar'"]) {|f| f.read}
assert_equal(%["foo 'bar'"\n], r, '[ruby-core:22960]')
end
}
end