test/io/console/test_io_console.rb: ignore TTOU on FreeBSD

I'm not entirely sure why, but SIGTTOU pauses the test
when running test-all in parallel.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2018-06-05 22:28:49 +00:00
Родитель 4e730838a0
Коммит bcd984f02f
1 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -12,6 +12,16 @@ end
defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
Bug6116 = '[ruby-dev:45309]' Bug6116 = '[ruby-dev:45309]'
# FreeBSD seems to hang on TTOU when running parallel tests
# tested on FreeBSD 11.x
def set_winsize_setup
@old_ttou = trap(:TTOU, 'IGNORE') if RUBY_PLATFORM =~ /freebsd/i
end
def set_winsize_teardown
trap(:TTOU, @old_ttou) if @old_ttou
end
def test_raw def test_raw
helper {|m, s| helper {|m, s|
s.print "abc\n" s.print "abc\n"
@ -255,6 +265,7 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
end end
def test_set_winsize_invalid_dev def test_set_winsize_invalid_dev
set_winsize_setup
[IO::NULL, __FILE__].each do |path| [IO::NULL, __FILE__].each do |path|
open(path) do |io| open(path) do |io|
begin begin
@ -267,6 +278,8 @@ defined?(PTY) and defined?(IO.console) and TestIO_Console.class_eval do
assert_raise(ArgumentError) {io.winsize = [0, 0, 0]} assert_raise(ArgumentError) {io.winsize = [0, 0, 0]}
end end
end end
ensure
set_winsize_teardown
end end
unless IO.console unless IO.console
@ -322,6 +335,7 @@ defined?(IO.console) and TestIO_Console.class_eval do
end end
def test_set_winsize_console def test_set_winsize_console
set_winsize_setup
s = IO.console.winsize s = IO.console.winsize
assert_nothing_raised(TypeError) {IO.console.winsize = s} assert_nothing_raised(TypeError) {IO.console.winsize = s}
bug = '[ruby-core:82741] [Bug #13888]' bug = '[ruby-core:82741] [Bug #13888]'
@ -329,6 +343,8 @@ defined?(IO.console) and TestIO_Console.class_eval do
assert_equal([s[0], s[1]+1], IO.console.winsize, bug) assert_equal([s[0], s[1]+1], IO.console.winsize, bug)
IO.console.winsize = s IO.console.winsize = s
assert_equal(s, IO.console.winsize, bug) assert_equal(s, IO.console.winsize, bug)
ensure
set_winsize_teardown
end end
def test_close def test_close