1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/lib/envutil.rb (File.mkfifo): Defined using mkfifo command.

* test/ruby/test_io.rb: Ditto.

* test/ruby/test_file_exhaustive.rb: Use File.mkfifo.

* test/ruby/test_process.rb: Ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2015-04-13 13:46:10 +00:00
parent 599bfa7233
commit 3024fc235a
5 changed files with 33 additions and 8 deletions

View file

@ -1,3 +1,13 @@
Mon Apr 13 22:44:07 2015 Tanaka Akira <akr@fsij.org>
* test/lib/envutil.rb (File.mkfifo): Defined using mkfifo command.
* test/ruby/test_io.rb: Ditto.
* test/ruby/test_file_exhaustive.rb: Use File.mkfifo.
* test/ruby/test_process.rb: Ditto.
Mon Apr 13 21:20:20 2015 CHIKANAGA Tomoyuki <nagachika@ruby-lang.org>
* ext/openssl/lib/openssl/ssl.rb: stricter hostname verification

View file

@ -3,6 +3,12 @@ require "open3"
require "timeout"
require_relative "find_executable"
def File.mkfifo(fn)
raise NotImplementedError, "does not support fifo" if /mswin|mingw|bccwin/ =~ RUBY_PLATFORM
ret = system("mkfifo", fn)
raise NotImplementedError, "mkfifo fails" if !ret
end
module EnvUtil
def rubybin
if ruby = ENV["RUBY"]

View file

@ -131,7 +131,7 @@ class TestFileExhaustive < Test::Unit::TestCase
return @fifo if defined? @fifo
if POSIX
fn = make_tmp_filename("fifo")
assert(system("mkfifo", fn), "mkfifo fails")
File.mkfifo(fn)
@fifo = fn
else
@fifo = nil

View file

@ -3180,7 +3180,7 @@ End
def test_open_fifo_does_not_block_other_threads
mkcdtmpdir {
assert(system("mkfifo", "fifo"), "mkfifo fails")
File.mkfifo("fifo")
assert_separately([], <<-'EOS')
t1 = Thread.new {
open("fifo", "r") {|r|

View file

@ -560,8 +560,11 @@ class TestProcess < Test::Unit::TestCase
def test_execopts_redirect_open_fifo
with_tmpchdir {|d|
system("mkfifo fifo")
return if !$?.success?
begin
File.mkfifo("fifo")
rescue NotImplementedError
return
end
assert(FileTest.pipe?("fifo"), "should be pipe")
t1 = Thread.new {
system(*ECHO["output to fifo"], :out=>"fifo")
@ -576,8 +579,11 @@ class TestProcess < Test::Unit::TestCase
def test_execopts_redirect_open_fifo_interrupt_raise
with_tmpchdir {|d|
system("mkfifo fifo")
return if !$?.success?
begin
File.mkfifo("fifo")
rescue NotImplementedError
return
end
IO.popen([RUBY, '-e', <<-'EOS']) {|io|
class E < StandardError; end
trap(:USR1) { raise E }
@ -596,8 +602,11 @@ class TestProcess < Test::Unit::TestCase
def test_execopts_redirect_open_fifo_interrupt_print
with_tmpchdir {|d|
system("mkfifo fifo")
return if !$?.success?
begin
File.mkfifo("fifo")
rescue NotImplementedError
return
end
IO.popen([RUBY, '-e', <<-'EOS']) {|io|
trap(:USR1) { print "trap\n" }
system("cat", :in => "fifo")