Use omit instead of skip: test/ruby/**/*.rb

This commit is contained in:
Hiroshi SHIBATA 2022-01-04 17:25:30 +09:00
parent f0669fb6cb
commit 47bf64a26d
No known key found for this signature in database
GPG Key ID: F9CF13417264FAC2
32 changed files with 112 additions and 112 deletions

View File

@ -257,13 +257,13 @@ class TestArgf < Test::Unit::TestCase
def test_inplace_nonascii def test_inplace_nonascii
ext = Encoding.default_external or ext = Encoding.default_external or
skip "no default external encoding" omit "no default external encoding"
t = nil t = nil
["\u{3042}", "\u{e9}"].any? do |n| ["\u{3042}", "\u{e9}"].any? do |n|
t = make_tempfile(n.encode(ext)) t = make_tempfile(n.encode(ext))
rescue Encoding::UndefinedConversionError rescue Encoding::UndefinedConversionError
end end
t or skip "no name to test" t or omit "no name to test"
assert_in_out_err(["-i.bak", "-", t.path], assert_in_out_err(["-i.bak", "-", t.path],
"#{<<~"{#"}\n#{<<~'};'}") "#{<<~"{#"}\n#{<<~'};'}")
{# {#

View File

@ -3270,7 +3270,7 @@ class TestArray < Test::Unit::TestCase
end end
EOS EOS
rescue Timeout::Error => e rescue Timeout::Error => e
skip e.message omit e.message
end end
end end

View File

@ -644,7 +644,7 @@ class TestBignum < Test::Unit::TestCase
thread.raise thread.raise
thread.join thread.join
time = Time.now - time time = Time.now - time
skip "too fast cpu" if end_flag omit "too fast cpu" if end_flag
assert_operator(time, :<, 10) assert_operator(time, :<, 10)
end end
@ -675,7 +675,7 @@ class TestBignum < Test::Unit::TestCase
return return
end end
end end
skip "cannot create suitable test case" omit "cannot create suitable test case"
ensure ensure
Signal.trap(:INT, oldtrap) if oldtrap Signal.trap(:INT, oldtrap) if oldtrap
end end

View File

@ -4,7 +4,7 @@ require 'test/unit'
class Complex_Test2 < Test::Unit::TestCase class Complex_Test2 < Test::Unit::TestCase
def test_kumi def test_kumi
skip unless defined?(Rational) omit unless defined?(Rational)
assert_equal(Complex(1, 0), +Complex(1, 0)) assert_equal(Complex(1, 0), +Complex(1, 0))
assert_equal(Complex(-1, 0), -Complex(1, 0)) assert_equal(Complex(-1, 0), -Complex(1, 0))

View File

@ -4,7 +4,7 @@ require 'test/unit'
class ComplexRational_Test < Test::Unit::TestCase class ComplexRational_Test < Test::Unit::TestCase
def test_rat_srat def test_rat_srat
skip unless defined?(Rational) omit unless defined?(Rational)
c = SimpleRat(1,3) c = SimpleRat(1,3)
cc = Rational(3,2) cc = Rational(3,2)
@ -89,7 +89,7 @@ class ComplexRational_Test < Test::Unit::TestCase
end end
def test_comp_srat def test_comp_srat
skip unless defined?(Rational) omit unless defined?(Rational)
c = Complex(SimpleRat(2,3),SimpleRat(1,2)) c = Complex(SimpleRat(2,3),SimpleRat(1,2))
cc = Complex(Rational(3,2),Rational(2,1)) cc = Complex(Rational(3,2),Rational(2,1))

View File

@ -4,7 +4,7 @@ require 'rubygems'
class TestDefaultGems < Test::Unit::TestCase class TestDefaultGems < Test::Unit::TestCase
def test_validate_gemspec def test_validate_gemspec
skip "git not found" unless system("git", "rev-parse", %i[out err]=>IO::NULL) omit "git not found" unless system("git", "rev-parse", %i[out err]=>IO::NULL)
srcdir = File.expand_path('../../..', __FILE__) srcdir = File.expand_path('../../..', __FILE__)
Dir.glob("#{srcdir}/{lib,ext}/**/*.gemspec").map do |src| Dir.glob("#{srcdir}/{lib,ext}/**/*.gemspec").map do |src|
assert_nothing_raised do assert_nothing_raised do

View File

@ -152,7 +152,7 @@ class TestDir < Test::Unit::TestCase
end end
def test_chroot_nodir def test_chroot_nodir
skip if RUBY_PLATFORM =~ /android/ omit if RUBY_PLATFORM =~ /android/
assert_raise(NotImplementedError, Errno::ENOENT, Errno::EPERM assert_raise(NotImplementedError, Errno::ENOENT, Errno::EPERM
) { Dir.chroot(File.join(@nodir, "")) } ) { Dir.chroot(File.join(@nodir, "")) }
end end
@ -490,9 +490,9 @@ class TestDir < Test::Unit::TestCase
def test_glob_legacy_short_name def test_glob_legacy_short_name
bug10819 = '[ruby-core:67954] [Bug #10819]' bug10819 = '[ruby-core:67954] [Bug #10819]'
bug11206 = '[ruby-core:69435] [Bug #11206]' bug11206 = '[ruby-core:69435] [Bug #11206]'
skip unless /\A\w:/ =~ ENV["ProgramFiles"] omit unless /\A\w:/ =~ ENV["ProgramFiles"]
short = "#$&/PROGRA~1" short = "#$&/PROGRA~1"
skip unless File.directory?(short) omit unless File.directory?(short)
entries = Dir.glob("#{short}/Common*") entries = Dir.glob("#{short}/Common*")
assert_not_empty(entries, bug10819) assert_not_empty(entries, bug10819)
long = File.expand_path(short) long = File.expand_path(short)

View File

@ -561,7 +561,7 @@ end.join
end end
def test_ensure_after_nomemoryerror def test_ensure_after_nomemoryerror
skip "Forcing NoMemoryError causes problems in some environments" omit "Forcing NoMemoryError causes problems in some environments"
assert_separately([], "$_ = 'a' * 1_000_000_000_000_000_000") assert_separately([], "$_ = 'a' * 1_000_000_000_000_000_000")
rescue NoMemoryError rescue NoMemoryError
assert_raise(NoMemoryError) do assert_raise(NoMemoryError) do
@ -1064,7 +1064,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
end end
def test_warn_deprecated_backwards_compatibility_category def test_warn_deprecated_backwards_compatibility_category
skip "no method to test" omit "no method to test"
warning = capture_warning_warn { } warning = capture_warning_warn { }
@ -1072,7 +1072,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
end end
def test_warn_deprecated_category def test_warn_deprecated_category
skip "no method to test" omit "no method to test"
warning = capture_warning_warn(category: true) { } warning = capture_warning_warn(category: true) { }

View File

@ -34,7 +34,7 @@ class TestFiber < Test::Unit::TestCase
end end
def test_many_fibers def test_many_fibers
skip 'This is unstable on GitHub Actions --jit-wait. TODO: debug it' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? omit 'This is unstable on GitHub Actions --jit-wait. TODO: debug it' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
max = 1000 max = 1000
assert_equal(max, max.times{ assert_equal(max, max.times{
Fiber.new{} Fiber.new{}
@ -381,7 +381,7 @@ class TestFiber < Test::Unit::TestCase
def test_fork_from_fiber def test_fork_from_fiber
skip 'fork not supported' unless Process.respond_to?(:fork) omit 'fork not supported' unless Process.respond_to?(:fork)
pid = nil pid = nil
bug5700 = '[ruby-core:41456]' bug5700 = '[ruby-core:41456]'
assert_nothing_raised(bug5700) do assert_nothing_raised(bug5700) do

View File

@ -273,7 +273,7 @@ class TestFile < Test::Unit::TestCase
begin begin
File.symlink(tst, a) File.symlink(tst, a)
rescue Errno::EACCES, Errno::EPERM rescue Errno::EACCES, Errno::EPERM
skip "need privilege" omit "need privilege"
end end
assert_equal(File.join(realdir, tst), File.realpath(a)) assert_equal(File.join(realdir, tst), File.realpath(a))
File.unlink(a) File.unlink(a)
@ -317,7 +317,7 @@ class TestFile < Test::Unit::TestCase
Dir.mktmpdir('rubytest-realpath') {|tmpdir| Dir.mktmpdir('rubytest-realpath') {|tmpdir|
Dir.chdir(tmpdir) do Dir.chdir(tmpdir) do
Dir.mkdir('foo') Dir.mkdir('foo')
skip "cannot run mklink" unless system('mklink /j bar foo > nul') omit "cannot run mklink" unless system('mklink /j bar foo > nul')
assert_equal(File.realpath('foo'), File.realpath('bar')) assert_equal(File.realpath('foo'), File.realpath('bar'))
end end
} }
@ -475,11 +475,11 @@ class TestFile < Test::Unit::TestCase
begin begin
io = File.open(tmpdir, File::RDWR | File::TMPFILE) io = File.open(tmpdir, File::RDWR | File::TMPFILE)
rescue Errno::EINVAL rescue Errno::EINVAL
skip 'O_TMPFILE not supported (EINVAL)' omit 'O_TMPFILE not supported (EINVAL)'
rescue Errno::EISDIR rescue Errno::EISDIR
skip 'O_TMPFILE not supported (EISDIR)' omit 'O_TMPFILE not supported (EISDIR)'
rescue Errno::EOPNOTSUPP rescue Errno::EOPNOTSUPP
skip 'O_TMPFILE not supported (EOPNOTSUPP)' omit 'O_TMPFILE not supported (EOPNOTSUPP)'
end end
io.write "foo" io.write "foo"

View File

@ -640,7 +640,7 @@ class TestFileExhaustive < Test::Unit::TestCase
end end
def test_birthtime def test_birthtime
skip if RUBY_PLATFORM =~ /android/ omit if RUBY_PLATFORM =~ /android/
[regular_file, utf8_file].each do |file| [regular_file, utf8_file].each do |file|
t1 = File.birthtime(file) t1 = File.birthtime(file)
t2 = File.open(file) {|f| f.birthtime} t2 = File.open(file) {|f| f.birthtime}
@ -773,7 +773,7 @@ class TestFileExhaustive < Test::Unit::TestCase
def test_readlink_junction def test_readlink_junction
base = File.basename(nofile) base = File.basename(nofile)
err = IO.popen(%W"cmd.exe /c mklink /j #{base} .", chdir: @dir, err: %i[child out], &:read) err = IO.popen(%W"cmd.exe /c mklink /j #{base} .", chdir: @dir, err: %i[child out], &:read)
skip err unless $?.success? omit err unless $?.success?
assert_equal(@dir, File.readlink(nofile)) assert_equal(@dir, File.readlink(nofile))
end end
@ -1119,7 +1119,7 @@ class TestFileExhaustive < Test::Unit::TestCase
def test_expand_path_for_existent_username def test_expand_path_for_existent_username
user = ENV['USER'] user = ENV['USER']
skip "ENV['USER'] is not set" unless user omit "ENV['USER'] is not set" unless user
assert_equal(ENV['HOME'], File.expand_path("~#{user}")) assert_equal(ENV['HOME'], File.expand_path("~#{user}"))
end unless DRIVE end unless DRIVE

View File

@ -54,7 +54,7 @@ class TestGc < Test::Unit::TestCase
def test_start_full_mark def test_start_full_mark
return unless use_rgengc? return unless use_rgengc?
skip 'stress' if GC.stress omit 'stress' if GC.stress
3.times { GC.start } # full mark and next time it should be minor mark 3.times { GC.start } # full mark and next time it should be minor mark
GC.start(full_mark: false) GC.start(full_mark: false)
@ -65,7 +65,7 @@ class TestGc < Test::Unit::TestCase
end end
def test_start_immediate_sweep def test_start_immediate_sweep
skip 'stress' if GC.stress omit 'stress' if GC.stress
GC.start(immediate_sweep: false) GC.start(immediate_sweep: false)
assert_equal false, GC.latest_gc_info(:immediate_sweep) assert_equal false, GC.latest_gc_info(:immediate_sweep)
@ -117,7 +117,7 @@ class TestGc < Test::Unit::TestCase
end end
def test_stat_single def test_stat_single
skip 'stress' if GC.stress omit 'stress' if GC.stress
stat = GC.stat stat = GC.stat
assert_equal stat[:count], GC.stat(:count) assert_equal stat[:count], GC.stat(:count)
@ -125,7 +125,7 @@ class TestGc < Test::Unit::TestCase
end end
def test_stat_constraints def test_stat_constraints
skip 'stress' if GC.stress omit 'stress' if GC.stress
stat = GC.stat stat = GC.stat
assert_equal stat[:total_allocated_pages], stat[:heap_allocated_pages] + stat[:total_freed_pages] assert_equal stat[:total_allocated_pages], stat[:heap_allocated_pages] + stat[:total_freed_pages]
@ -140,7 +140,7 @@ class TestGc < Test::Unit::TestCase
end end
def test_latest_gc_info def test_latest_gc_info
skip 'stress' if GC.stress omit 'stress' if GC.stress
assert_separately %w[--disable-gem], __FILE__, __LINE__, <<-'eom' assert_separately %w[--disable-gem], __FILE__, __LINE__, <<-'eom'
GC.start GC.start
@ -280,7 +280,7 @@ class TestGc < Test::Unit::TestCase
end end
def test_profiler_clear def test_profiler_clear
skip "for now" omit "for now"
assert_separately %w[--disable-gem], __FILE__, __LINE__, <<-'eom', timeout: 30 assert_separately %w[--disable-gem], __FILE__, __LINE__, <<-'eom', timeout: 30
GC::Profiler.enable GC::Profiler.enable

View File

@ -11,7 +11,7 @@ end
class TestGCCompact < Test::Unit::TestCase class TestGCCompact < Test::Unit::TestCase
module SupportsCompact module SupportsCompact
def setup def setup
skip "autocompact not supported on this platform" unless supports_auto_compact? omit "autocompact not supported on this platform" unless supports_auto_compact?
super super
end end
@ -78,7 +78,7 @@ class TestGCCompact < Test::Unit::TestCase
n.times do n.times do
break if count < GC.stat(:compact_count) break if count < GC.stat(:compact_count)
list2 << Object.new list2 << Object.new
end and skip "implicit compaction didn't happen within #{n} objects" end and omit "implicit compaction didn't happen within #{n} objects"
compact_stats = GC.latest_compact_info compact_stats = GC.latest_compact_info
refute_predicate compact_stats[:considered], :empty? refute_predicate compact_stats[:considered], :empty?
refute_predicate compact_stats[:moved], :empty? refute_predicate compact_stats[:moved], :empty?
@ -92,7 +92,7 @@ class TestGCCompact < Test::Unit::TestCase
end end
def setup def setup
skip "autocompact not supported on this platform" unless supports_auto_compact? omit "autocompact not supported on this platform" unless supports_auto_compact?
super super
end end

View File

@ -655,8 +655,8 @@ class TestIO < Test::Unit::TestCase
if have_nonblock? if have_nonblock?
def test_copy_stream_no_busy_wait def test_copy_stream_no_busy_wait
skip "MJIT has busy wait on GC. This sometimes fails with --jit." if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? omit "MJIT has busy wait on GC. This sometimes fails with --jit." if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
skip "multiple threads already active" if Thread.list.size > 1 omit "multiple threads already active" if Thread.list.size > 1
msg = 'r58534 [ruby-core:80969] [Backport #13533]' msg = 'r58534 [ruby-core:80969] [Backport #13533]'
IO.pipe do |r,w| IO.pipe do |r,w|
@ -675,7 +675,7 @@ class TestIO < Test::Unit::TestCase
begin begin
w2.nonblock = true w2.nonblock = true
rescue Errno::EBADF rescue Errno::EBADF
skip "nonblocking IO for pipe is not implemented" omit "nonblocking IO for pipe is not implemented"
end end
s = w2.syswrite("a" * 100000) s = w2.syswrite("a" * 100000)
t = Thread.new { sleep 0.1; r2.read } t = Thread.new { sleep 0.1; r2.read }
@ -779,7 +779,7 @@ class TestIO < Test::Unit::TestCase
r1.nonblock = true r1.nonblock = true
w2.nonblock = true w2.nonblock = true
rescue Errno::EBADF rescue Errno::EBADF
skip "nonblocking IO for pipe is not implemented" omit "nonblocking IO for pipe is not implemented"
end end
t1 = Thread.new { w1 << megacontent; w1.close } t1 = Thread.new { w1 << megacontent; w1.close }
t2 = Thread.new { r2.read } t2 = Thread.new { r2.read }
@ -843,7 +843,7 @@ class TestIO < Test::Unit::TestCase
assert_equal("bcd", r.read) assert_equal("bcd", r.read)
end) end)
rescue NotImplementedError rescue NotImplementedError
skip "pread(2) is not implemtented." omit "pread(2) is not implemtented."
end end
} }
end end
@ -947,7 +947,7 @@ class TestIO < Test::Unit::TestCase
begin begin
s1.nonblock = true s1.nonblock = true
rescue Errno::EBADF rescue Errno::EBADF
skip "nonblocking IO for pipe is not implemented" omit "nonblocking IO for pipe is not implemented"
end end
t1 = Thread.new { s2.read } t1 = Thread.new { s2.read }
t2 = Thread.new { t2 = Thread.new {
@ -971,7 +971,7 @@ class TestIO < Test::Unit::TestCase
begin begin
s1.nonblock = true s1.nonblock = true
rescue Errno::EBADF rescue Errno::EBADF
skip "nonblocking IO for pipe is not implemented" omit "nonblocking IO for pipe is not implemented"
end end
trapping_usr2 do |rd| trapping_usr2 do |rd|
nr = 30 nr = 30
@ -1631,7 +1631,7 @@ class TestIO < Test::Unit::TestCase
end if have_nonblock? end if have_nonblock?
def test_read_nonblock_no_exceptions def test_read_nonblock_no_exceptions
skip '[ruby-core:90895] MJIT worker may leave fd open in a forked child' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # TODO: consider acquiring GVL from MJIT worker. omit '[ruby-core:90895] MJIT worker may leave fd open in a forked child' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # TODO: consider acquiring GVL from MJIT worker.
with_pipe {|r, w| with_pipe {|r, w|
assert_equal :wait_readable, r.read_nonblock(4096, exception: false) assert_equal :wait_readable, r.read_nonblock(4096, exception: false)
w.puts "HI!" w.puts "HI!"
@ -2279,7 +2279,7 @@ class TestIO < Test::Unit::TestCase
def test_autoclose_true_closed_by_finalizer def test_autoclose_true_closed_by_finalizer
# http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1465760 # http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1465760
# http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1469765 # http://ci.rvm.jp/results/trunk-mjit@silicon-docker/1469765
skip 'this randomly fails with MJIT' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? omit 'this randomly fails with MJIT' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
feature2250 = '[ruby-core:26222]' feature2250 = '[ruby-core:26222]'
pre = 'ft2250' pre = 'ft2250'
@ -2291,7 +2291,7 @@ class TestIO < Test::Unit::TestCase
t.close t.close
rescue Errno::EBADF rescue Errno::EBADF
end end
skip "expect IO object was GC'ed but not recycled yet" omit "expect IO object was GC'ed but not recycled yet"
rescue WeakRef::RefError rescue WeakRef::RefError
assert_raise(Errno::EBADF, feature2250) {t.close} assert_raise(Errno::EBADF, feature2250) {t.close}
end end
@ -2307,7 +2307,7 @@ class TestIO < Test::Unit::TestCase
begin begin
w.close w.close
t.close t.close
skip "expect IO object was GC'ed but not recycled yet" omit "expect IO object was GC'ed but not recycled yet"
rescue WeakRef::RefError rescue WeakRef::RefError
assert_nothing_raised(Errno::EBADF, feature2250) {t.close} assert_nothing_raised(Errno::EBADF, feature2250) {t.close}
end end
@ -2670,7 +2670,7 @@ class TestIO < Test::Unit::TestCase
end end
def test_puts_parallel def test_puts_parallel
skip "not portable" omit "not portable"
pipe(proc do |w| pipe(proc do |w|
threads = [] threads = []
100.times do 100.times do
@ -3304,7 +3304,7 @@ __END__
begin begin
f = File.open('/dev/tty') f = File.open('/dev/tty')
rescue Errno::ENOENT, Errno::ENXIO => e rescue Errno::ENOENT, Errno::ENXIO => e
skip e.message omit e.message
else else
tiocgwinsz=0x5413 tiocgwinsz=0x5413
winsize="" winsize=""
@ -3430,10 +3430,10 @@ __END__
with_pipe do |r,w| with_pipe do |r,w|
# Linux 2.6.15 and earlier returned EINVAL instead of ESPIPE # Linux 2.6.15 and earlier returned EINVAL instead of ESPIPE
assert_raise(Errno::ESPIPE, Errno::EINVAL) { assert_raise(Errno::ESPIPE, Errno::EINVAL) {
r.advise(:willneed) or skip "fadvise(2) is not implemented" r.advise(:willneed) or omit "fadvise(2) is not implemented"
} }
assert_raise(Errno::ESPIPE, Errno::EINVAL) { assert_raise(Errno::ESPIPE, Errno::EINVAL) {
w.advise(:willneed) or skip "fadvise(2) is not implemented" w.advise(:willneed) or omit "fadvise(2) is not implemented"
} }
end end
end if /linux/ =~ RUBY_PLATFORM end if /linux/ =~ RUBY_PLATFORM
@ -3573,14 +3573,14 @@ __END__
f.write('1') f.write('1')
pos = f.tell pos = f.tell
rescue Errno::ENOSPC rescue Errno::ENOSPC
skip "non-sparse file system" omit "non-sparse file system"
rescue SystemCallError rescue SystemCallError
else else
assert_equal(0x1_0000_0000, pos, msg) assert_equal(0x1_0000_0000, pos, msg)
end end
end; end;
rescue Timeout::Error rescue Timeout::Error
skip "Timeout because of slow file writing" omit "Timeout because of slow file writing"
end end
} }
end if /mswin|mingw/ =~ RUBY_PLATFORM end if /mswin|mingw/ =~ RUBY_PLATFORM

View File

@ -539,7 +539,7 @@ class TestISeq < Test::Unit::TestCase
bin = assert_nothing_raised(mesg) do bin = assert_nothing_raised(mesg) do
iseq.to_binary iseq.to_binary
rescue RuntimeError => e rescue RuntimeError => e
skip e.message if /compile with coverage/ =~ e.message omit e.message if /compile with coverage/ =~ e.message
raise raise
end end
10.times do 10.times do

View File

@ -64,7 +64,7 @@ class TestJIT < Test::Unit::TestCase
def setup def setup
unless JITSupport.supported? unless JITSupport.supported?
skip 'JIT seems not supported on this platform' omit 'JIT seems not supported on this platform'
end end
self.class.setup self.class.setup
end end
@ -321,7 +321,7 @@ class TestJIT < Test::Unit::TestCase
end end
def test_compile_insn_reput def test_compile_insn_reput
skip "write test" omit "write test"
end end
def test_compile_insn_setn def test_compile_insn_setn
@ -352,11 +352,11 @@ class TestJIT < Test::Unit::TestCase
end end
def test_compile_insn_tracecoverage def test_compile_insn_tracecoverage
skip "write test" omit "write test"
end end
def test_compile_insn_defineclass def test_compile_insn_defineclass
skip "support this in mjit_compile (low priority)" omit "support this in mjit_compile (low priority)"
end end
def test_compile_insn_send def test_compile_insn_send
@ -709,7 +709,7 @@ class TestJIT < Test::Unit::TestCase
if RUBY_PLATFORM.match?(/mswin/) if RUBY_PLATFORM.match?(/mswin/)
# "Permission Denied" error is preventing to remove so file on AppVeyor/RubyCI. # "Permission Denied" error is preventing to remove so file on AppVeyor/RubyCI.
skip 'Removing so file is randomly failing on AppVeyor/RubyCI mswin due to Permission Denied.' omit 'Removing so file is randomly failing on AppVeyor/RubyCI mswin due to Permission Denied.'
else else
# verify .c files are deleted on unload_units # verify .c files are deleted on unload_units
assert_send([Dir, :empty?, dir], debug_info) assert_send([Dir, :empty?, dir], debug_info)
@ -996,7 +996,7 @@ class TestJIT < Test::Unit::TestCase
def test_clean_so def test_clean_so
if RUBY_PLATFORM.match?(/mswin/) if RUBY_PLATFORM.match?(/mswin/)
skip 'Removing so file is randomly failing on AppVeyor/RubyCI mswin due to Permission Denied.' omit 'Removing so file is randomly failing on AppVeyor/RubyCI mswin due to Permission Denied.'
end end
Dir.mktmpdir("jit_test_clean_so_") do |dir| Dir.mktmpdir("jit_test_clean_so_") do |dir|
code = "x = 0; 10.times {|i|x+=i}" code = "x = 0; 10.times {|i|x+=i}"
@ -1010,7 +1010,7 @@ class TestJIT < Test::Unit::TestCase
def test_clean_objects_on_exec def test_clean_objects_on_exec
if /mswin|mingw/ =~ RUBY_PLATFORM if /mswin|mingw/ =~ RUBY_PLATFORM
# TODO: check call stack and close handle of code which is not on stack, and remove objects on best-effort basis # TODO: check call stack and close handle of code which is not on stack, and remove objects on best-effort basis
skip 'Removing so file being used does not work on Windows' omit 'Removing so file being used does not work on Windows'
end end
Dir.mktmpdir("jit_test_clean_objects_on_exec_") do |dir| Dir.mktmpdir("jit_test_clean_objects_on_exec_") do |dir|
eval_with_jit({"TMPDIR"=>dir}, "#{<<~"begin;"}\n#{<<~"end;"}", min_calls: 1) eval_with_jit({"TMPDIR"=>dir}, "#{<<~"begin;"}\n#{<<~"end;"}", min_calls: 1)

View File

@ -300,7 +300,7 @@ class TestM17N < Test::Unit::TestCase
orig_int, Encoding.default_internal = Encoding.default_internal, nil orig_int, Encoding.default_internal = Encoding.default_internal, nil
orig_ext = Encoding.default_external orig_ext = Encoding.default_external
skip "https://bugs.ruby-lang.org/issues/18338" omit "https://bugs.ruby-lang.org/issues/18338"
o = Object.new o = Object.new

View File

@ -1207,7 +1207,7 @@ class TestMethod < Test::Unit::TestCase
def test_splat_long_array def test_splat_long_array
if File.exist?('/etc/os-release') && File.read('/etc/os-release').include?('openSUSE Leap') if File.exist?('/etc/os-release') && File.read('/etc/os-release').include?('openSUSE Leap')
# For RubyCI's openSUSE machine http://rubyci.s3.amazonaws.com/opensuseleap/ruby-trunk/recent.html, which tends to die with NoMemoryError here. # For RubyCI's openSUSE machine http://rubyci.s3.amazonaws.com/opensuseleap/ruby-trunk/recent.html, which tends to die with NoMemoryError here.
skip 'do not exhaust memory on RubyCI openSUSE Leap machine' omit 'do not exhaust memory on RubyCI openSUSE Leap machine'
end end
n = 10_000_000 n = 10_000_000
assert_equal n , rest_parameter(*(1..n)).size, '[Feature #10440]' assert_equal n , rest_parameter(*(1..n)).size, '[Feature #10440]'

View File

@ -510,7 +510,7 @@ class TestRubyOptimization < Test::Unit::TestCase
end end
def test_tailcall_not_to_grow_stack def test_tailcall_not_to_grow_stack
skip 'currently JIT-ed code always creates a new stack frame' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? omit 'currently JIT-ed code always creates a new stack frame' if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?
bug16161 = '[ruby-core:94881]' bug16161 = '[ruby-core:94881]'
tailcall("#{<<-"begin;"}\n#{<<~"end;"}") tailcall("#{<<-"begin;"}\n#{<<~"end;"}")

View File

@ -169,7 +169,7 @@ class TestProcess < Test::Unit::TestCase
end end
def test_execopts_pgroup def test_execopts_pgroup
skip "system(:pgroup) is not supported" if windows? omit "system(:pgroup) is not supported" if windows?
assert_nothing_raised { system(*TRUECOMMAND, :pgroup=>false) } assert_nothing_raised { system(*TRUECOMMAND, :pgroup=>false) }
io = IO.popen([RUBY, "-e", "print Process.getpgrp"]) io = IO.popen([RUBY, "-e", "print Process.getpgrp"])
@ -511,7 +511,7 @@ class TestProcess < Test::Unit::TestCase
UMASK = [RUBY, '-e', 'printf "%04o\n", File.umask'] UMASK = [RUBY, '-e', 'printf "%04o\n", File.umask']
def test_execopts_umask def test_execopts_umask
skip "umask is not supported" if windows? omit "umask is not supported" if windows?
IO.popen([*UMASK, :umask => 0]) {|io| IO.popen([*UMASK, :umask => 0]) {|io|
assert_equal("0000", io.read.chomp) assert_equal("0000", io.read.chomp)
} }
@ -837,7 +837,7 @@ class TestProcess < Test::Unit::TestCase
STDERR=>"out", STDOUT=>[:child, STDERR]) STDERR=>"out", STDOUT=>[:child, STDERR])
assert_equal("errout", File.read("out")) assert_equal("errout", File.read("out"))
skip "inheritance of fd other than stdin,stdout and stderr is not supported" if windows? omit "inheritance of fd other than stdin,stdout and stderr is not supported" if windows?
Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'", Process.wait spawn(RUBY, "-e", "STDERR.print 'err'; STDOUT.print 'out'",
STDOUT=>"out", STDOUT=>"out",
STDERR=>[:child, 3], STDERR=>[:child, 3],
@ -889,7 +889,7 @@ class TestProcess < Test::Unit::TestCase
end end
def test_execopts_popen_extra_fd def test_execopts_popen_extra_fd
skip "inheritance of fd other than stdin,stdout and stderr is not supported" if windows? omit "inheritance of fd other than stdin,stdout and stderr is not supported" if windows?
with_tmpchdir {|d| with_tmpchdir {|d|
with_pipe {|r, w| with_pipe {|r, w|
IO.popen([RUBY, '-e', 'IO.new(3, "w").puts("a"); puts "b"', 3=>w]) {|io| IO.popen([RUBY, '-e', 'IO.new(3, "w").puts("a"); puts "b"', 3=>w]) {|io|
@ -918,7 +918,7 @@ class TestProcess < Test::Unit::TestCase
end end
def test_fd_inheritance def test_fd_inheritance
skip "inheritance of fd other than stdin,stdout and stderr is not supported" if windows? omit "inheritance of fd other than stdin,stdout and stderr is not supported" if windows?
with_pipe {|r, w| with_pipe {|r, w|
system(RUBY, '-e', 'IO.new(ARGV[0].to_i, "w").puts(:ba)', w.fileno.to_s, w=>w) system(RUBY, '-e', 'IO.new(ARGV[0].to_i, "w").puts(:ba)', w.fileno.to_s, w=>w)
w.close w.close
@ -964,7 +964,7 @@ class TestProcess < Test::Unit::TestCase
end end
def test_execopts_close_others def test_execopts_close_others
skip "inheritance of fd other than stdin,stdout and stderr is not supported" if windows? omit "inheritance of fd other than stdin,stdout and stderr is not supported" if windows?
with_tmpchdir {|d| with_tmpchdir {|d|
with_pipe {|r, w| with_pipe {|r, w|
system(RUBY, '-e', 'STDERR.reopen("err", "w"); IO.new(ARGV[0].to_i, "w").puts("ma")', w.fileno.to_s, :close_others=>true) system(RUBY, '-e', 'STDERR.reopen("err", "w"); IO.new(ARGV[0].to_i, "w").puts("ma")', w.fileno.to_s, :close_others=>true)
@ -1058,7 +1058,7 @@ class TestProcess < Test::Unit::TestCase
} }
} }
rescue NotImplementedError rescue NotImplementedError
skip "IO#close_on_exec= is not supported" omit "IO#close_on_exec= is not supported"
end end
end unless windows? # passing non-stdio fds is not supported on Windows end unless windows? # passing non-stdio fds is not supported on Windows
@ -1610,7 +1610,7 @@ class TestProcess < Test::Unit::TestCase
else else
assert_kind_of(Integer, max) assert_kind_of(Integer, max)
assert_predicate(max, :positive?) assert_predicate(max, :positive?)
skip "not limited to NGROUPS_MAX" if /darwin/ =~ RUBY_PLATFORM omit "not limited to NGROUPS_MAX" if /darwin/ =~ RUBY_PLATFORM
gs = Process.groups gs = Process.groups
assert_operator(gs.size, :<=, max) assert_operator(gs.size, :<=, max)
gs[0] ||= 0 gs[0] ||= 0
@ -1637,7 +1637,7 @@ class TestProcess < Test::Unit::TestCase
end end
def test_setegid def test_setegid
skip "root can use Process.egid on Android platform" if RUBY_PLATFORM =~ /android/ omit "root can use Process.egid on Android platform" if RUBY_PLATFORM =~ /android/
assert_nothing_raised(TypeError) {Process.egid += 0} assert_nothing_raised(TypeError) {Process.egid += 0}
rescue NotImplementedError rescue NotImplementedError
end end
@ -1698,7 +1698,7 @@ class TestProcess < Test::Unit::TestCase
if /freebsd|openbsd/ =~ RUBY_PLATFORM if /freebsd|openbsd/ =~ RUBY_PLATFORM
# this relates #4173 # this relates #4173
# When ruby can use 2 cores, signal and wait4 may miss the signal. # When ruby can use 2 cores, signal and wait4 may miss the signal.
skip "this fails on FreeBSD and OpenBSD on multithreaded environment" omit "this fails on FreeBSD and OpenBSD on multithreaded environment"
end end
signal_received = [] signal_received = []
IO.pipe do |sig_r, sig_w| IO.pipe do |sig_r, sig_w|
@ -1733,7 +1733,7 @@ class TestProcess < Test::Unit::TestCase
def test_no_curdir def test_no_curdir
if /solaris/i =~ RUBY_PLATFORM if /solaris/i =~ RUBY_PLATFORM
skip "Temporary skip to avoid CI failures after commit to use realpath on required files" omit "Temporary omit to avoid CI failures after commit to use realpath on required files"
end end
with_tmpchdir {|d| with_tmpchdir {|d|
Dir.mkdir("vd") Dir.mkdir("vd")
@ -1775,7 +1775,7 @@ class TestProcess < Test::Unit::TestCase
def test_aspawn_too_long_path def test_aspawn_too_long_path
if /solaris/i =~ RUBY_PLATFORM && !defined?(Process::RLIMIT_NPROC) if /solaris/i =~ RUBY_PLATFORM && !defined?(Process::RLIMIT_NPROC)
skip "Too exhaustive test on platforms without Process::RLIMIT_NPROC such as Solaris 10" omit "Too exhaustive test on platforms without Process::RLIMIT_NPROC such as Solaris 10"
end end
bug4315 = '[ruby-core:34833] #7904 [ruby-core:52628] #11613' bug4315 = '[ruby-core:34833] #7904 [ruby-core:52628] #11613'
assert_fail_too_long_path(%w"echo |", bug4315) assert_fail_too_long_path(%w"echo |", bug4315)
@ -1958,7 +1958,7 @@ class TestProcess < Test::Unit::TestCase
end end
def test_execopts_uid def test_execopts_uid
skip "root can use uid option of Kernel#system on Android platform" if RUBY_PLATFORM =~ /android/ omit "root can use uid option of Kernel#system on Android platform" if RUBY_PLATFORM =~ /android/
feature6975 = '[ruby-core:47414]' feature6975 = '[ruby-core:47414]'
[30000, [Process.uid, ENV["USER"]]].each do |uid, user| [30000, [Process.uid, ENV["USER"]]].each do |uid, user|
@ -1989,8 +1989,8 @@ class TestProcess < Test::Unit::TestCase
end end
def test_execopts_gid def test_execopts_gid
skip "Process.groups not implemented on Windows platform" if windows? omit "Process.groups not implemented on Windows platform" if windows?
skip "root can use Process.groups on Android platform" if RUBY_PLATFORM =~ /android/ omit "root can use Process.groups on Android platform" if RUBY_PLATFORM =~ /android/
feature6975 = '[ruby-core:47414]' feature6975 = '[ruby-core:47414]'
groups = Process.groups.map do |g| groups = Process.groups.map do |g|
@ -2511,7 +2511,7 @@ EOS
end end
def test_forked_child_handles_signal def test_forked_child_handles_signal
skip "fork not supported" unless Process.respond_to?(:fork) omit "fork not supported" unless Process.respond_to?(:fork)
assert_normal_exit(<<-"end;", '[ruby-core:82883] [Bug #13916]') assert_normal_exit(<<-"end;", '[ruby-core:82883] [Bug #13916]')
require 'timeout' require 'timeout'
pid = fork { sleep } pid = fork { sleep }

View File

@ -225,7 +225,7 @@ class TestRefinement < Test::Unit::TestCase
end end
end end
def test_method_should_use_refinements def test_method_should_use_refinements
skip if Test::Unit::Runner.current_repeat_count > 0 omit if Test::Unit::Runner.current_repeat_count > 0
foo = Foo.new foo = Foo.new
assert_raise(NameError) { foo.method(:z) } assert_raise(NameError) { foo.method(:z) }
@ -248,7 +248,7 @@ class TestRefinement < Test::Unit::TestCase
end end
end end
def test_instance_method_should_use_refinements def test_instance_method_should_use_refinements
skip if Test::Unit::Runner.current_repeat_count > 0 omit if Test::Unit::Runner.current_repeat_count > 0
foo = Foo.new foo = Foo.new
assert_raise(NameError) { Foo.instance_method(:z) } assert_raise(NameError) { Foo.instance_method(:z) }
@ -819,7 +819,7 @@ class TestRefinement < Test::Unit::TestCase
def test_prepend_after_refine_wb_miss def test_prepend_after_refine_wb_miss
if /\A(arm|mips)/ =~ RUBY_PLATFORM if /\A(arm|mips)/ =~ RUBY_PLATFORM
skip "too slow cpu" omit "too slow cpu"
end end
assert_normal_exit %Q{ assert_normal_exit %Q{
GC.stress = true GC.stress = true

View File

@ -93,7 +93,7 @@ class TestRequire < Test::Unit::TestCase
begin begin
require_path = File.join(tmp, dir, 'foo.rb').encode(encoding) require_path = File.join(tmp, dir, 'foo.rb').encode(encoding)
rescue rescue
skip "cannot convert path encoding to #{encoding}" omit "cannot convert path encoding to #{encoding}"
end end
Dir.mkdir(File.dirname(require_path)) Dir.mkdir(File.dirname(require_path))
open(require_path, "wb") {|f| f.puts '$:.push __FILE__'} open(require_path, "wb") {|f| f.puts '$:.push __FILE__'}
@ -175,7 +175,7 @@ class TestRequire < Test::Unit::TestCase
t.close t.close
path = File.expand_path(t.path).sub(/\A(\w):/, '//127.0.0.1/\1$') path = File.expand_path(t.path).sub(/\A(\w):/, '//127.0.0.1/\1$')
skip "local drive #$1: is not shared" unless File.exist?(path) omit "local drive #$1: is not shared" unless File.exist?(path)
args = ['--disable-gems', "-I#{File.dirname(path)}"] args = ['--disable-gems', "-I#{File.dirname(path)}"]
assert_in_out_err(args, "#{<<~"END;"}", [path], []) assert_in_out_err(args, "#{<<~"END;"}", [path], [])
begin begin
@ -460,7 +460,7 @@ class TestRequire < Test::Unit::TestCase
result = IO.popen([EnvUtil.rubybin, "b/tst.rb"], &:read) result = IO.popen([EnvUtil.rubybin, "b/tst.rb"], &:read)
assert_equal("a/lib.rb\n", result, "[ruby-dev:40040]") assert_equal("a/lib.rb\n", result, "[ruby-dev:40040]")
rescue NotImplementedError, Errno::EACCES rescue NotImplementedError, Errno::EACCES
skip "File.symlink is not implemented" omit "File.symlink is not implemented"
end end
} }
} }
@ -486,7 +486,7 @@ class TestRequire < Test::Unit::TestCase
result = IO.popen([EnvUtil.rubybin, "c.rb"], &:read) result = IO.popen([EnvUtil.rubybin, "c.rb"], &:read)
assert_equal("1", result, "bug17885 [ruby-core:104010]") assert_equal("1", result, "bug17885 [ruby-core:104010]")
rescue NotImplementedError, Errno::EACCES rescue NotImplementedError, Errno::EACCES
skip "File.symlink is not implemented" omit "File.symlink is not implemented"
end end
} }
} }
@ -850,7 +850,7 @@ class TestRequire < Test::Unit::TestCase
end if File.respond_to?(:mkfifo) end if File.respond_to?(:mkfifo)
def test_loading_fifo_fd_leak def test_loading_fifo_fd_leak
skip if RUBY_PLATFORM =~ /android/ # https://rubyci.org/logs/rubyci.s3.amazonaws.com/android29-x86_64/ruby-master/log/20200419T124100Z.fail.html.gz omit if RUBY_PLATFORM =~ /android/ # https://rubyci.org/logs/rubyci.s3.amazonaws.com/android29-x86_64/ruby-master/log/20200419T124100Z.fail.html.gz
Tempfile.create(%w'fifo .rb') {|f| Tempfile.create(%w'fifo .rb') {|f|
f.close f.close
@ -911,7 +911,7 @@ class TestRequire < Test::Unit::TestCase
begin begin
File.symlink "real", File.join(tmp, "symlink") File.symlink "real", File.join(tmp, "symlink")
rescue NotImplementedError, Errno::EACCES rescue NotImplementedError, Errno::EACCES
skip "File.symlink is not implemented" omit "File.symlink is not implemented"
end end
File.write(File.join(tmp, "real/test_symlink_load_path.rb"), "print __FILE__") File.write(File.join(tmp, "real/test_symlink_load_path.rb"), "print __FILE__")
result = IO.popen([EnvUtil.rubybin, "-I#{tmp}/symlink", "-e", "require 'test_symlink_load_path.rb'"], &:read) result = IO.popen([EnvUtil.rubybin, "-I#{tmp}/symlink", "-e", "require 'test_symlink_load_path.rb'"], &:read)

View File

@ -18,7 +18,7 @@ class TestRequireLib < Test::Unit::TestCase
begin begin
require #{lib.dump} require #{lib.dump}
rescue Exception rescue Exception
skip $! omit $!
end end
assert_equal n, Thread.list.size assert_equal n, Thread.list.size
end; end;

View File

@ -674,7 +674,7 @@ class TestRubyOptions < Test::Unit::TestCase
end end
def test_set_program_name def test_set_program_name
skip "platform dependent feature" unless defined?(PSCMD) and PSCMD omit "platform dependent feature" unless defined?(PSCMD) and PSCMD
with_tmpchdir do with_tmpchdir do
write_file("test-script", "$0 = 'hello world'; /test-script/ =~ Process.argv0 or $0 = 'Process.argv0 changed!'; sleep 60") write_file("test-script", "$0 = 'hello world'; /test-script/ =~ Process.argv0 or $0 = 'Process.argv0 changed!'; sleep 60")
@ -697,7 +697,7 @@ class TestRubyOptions < Test::Unit::TestCase
end end
def test_setproctitle def test_setproctitle
skip "platform dependent feature" unless defined?(PSCMD) and PSCMD omit "platform dependent feature" unless defined?(PSCMD) and PSCMD
assert_separately([], "#{<<-"{#"}\n#{<<-'};'}") assert_separately([], "#{<<-"{#"}\n#{<<-'};'}")
{# {#
@ -772,7 +772,7 @@ class TestRubyOptions < Test::Unit::TestCase
end end
def assert_segv(args, message=nil) def assert_segv(args, message=nil)
skip if ENV['RUBY_ON_BUG'] omit if ENV['RUBY_ON_BUG']
test_stdin = "" test_stdin = ""
opt = SEGVTest::ExecOptions.dup opt = SEGVTest::ExecOptions.dup
@ -857,7 +857,7 @@ class TestRubyOptions < Test::Unit::TestCase
Process.wait pid Process.wait pid
} }
rescue RuntimeError rescue RuntimeError
skip $! omit $!
end end
} }
assert_equal("", result, '[ruby-dev:37798]') assert_equal("", result, '[ruby-dev:37798]')
@ -907,7 +907,7 @@ class TestRubyOptions < Test::Unit::TestCase
name = c.chr(Encoding::UTF_8) name = c.chr(Encoding::UTF_8)
expected = name.encode("locale") rescue nil expected = name.encode("locale") rescue nil
} }
skip "can't make locale name" omit "can't make locale name"
end end
name << ".rb" name << ".rb"
expected << ".rb" expected << ".rb"
@ -1115,7 +1115,7 @@ class TestRubyOptions < Test::Unit::TestCase
end end
def test_null_script def test_null_script
skip "#{IO::NULL} is not a character device" unless File.chardev?(IO::NULL) omit "#{IO::NULL} is not a character device" unless File.chardev?(IO::NULL)
assert_in_out_err([IO::NULL], success: true) assert_in_out_err([IO::NULL], success: true)
end end

View File

@ -9,7 +9,7 @@ class TestRubyVMJIT < Test::Unit::TestCase
def setup def setup
unless JITSupport.supported? unless JITSupport.supported?
skip 'JIT seems not supported on this platform' omit 'JIT seems not supported on this platform'
end end
end end

View File

@ -2371,7 +2371,7 @@ CODE
} }
assert_equal [], events, 'script_compiled event should not be invoked on compile error' assert_equal [], events, 'script_compiled event should not be invoked on compile error'
skip "TODO: test for requires" omit "TODO: test for requires"
events.clear events.clear
tp.enable{ tp.enable{

View File

@ -323,7 +323,7 @@ class TestSignal < Test::Unit::TestCase
end end
def test_sigchld_ignore def test_sigchld_ignore
skip 'no SIGCHLD' unless Signal.list['CHLD'] omit 'no SIGCHLD' unless Signal.list['CHLD']
old = trap(:CHLD, 'IGNORE') old = trap(:CHLD, 'IGNORE')
cmd = [ EnvUtil.rubybin, '--disable=gems', '-e' ] cmd = [ EnvUtil.rubybin, '--disable=gems', '-e' ]
assert(system(*cmd, 'exit!(0)'), 'no ECHILD') assert(system(*cmd, 'exit!(0)'), 'no ECHILD')

View File

@ -500,7 +500,7 @@ class TestThread < Test::Unit::TestCase
def test_ignore_deadlock def test_ignore_deadlock
if /mswin|mingw/ =~ RUBY_PLATFORM if /mswin|mingw/ =~ RUBY_PLATFORM
skip "can't trap a signal from another process on Windows" omit "can't trap a signal from another process on Windows"
end end
assert_in_out_err([], <<-INPUT, %w(false :sig), [], :signal=>:INT, timeout: 1, timeout_error: nil) assert_in_out_err([], <<-INPUT, %w(false :sig), [], :signal=>:INT, timeout: 1, timeout_error: nil)
p Thread.ignore_deadlock p Thread.ignore_deadlock
@ -731,7 +731,7 @@ class TestThread < Test::Unit::TestCase
end end
def test_no_valid_cfp def test_no_valid_cfp
skip 'with win32ole, cannot run this testcase because win32ole redefines Thread#initialize' if defined?(WIN32OLE) omit 'with win32ole, cannot run this testcase because win32ole redefines Thread#initialize' if defined?(WIN32OLE)
bug5083 = '[ruby-dev:44208]' bug5083 = '[ruby-dev:44208]'
assert_equal([], Thread.new(&Module.method(:nesting)).value, bug5083) assert_equal([], Thread.new(&Module.method(:nesting)).value, bug5083)
assert_instance_of(Thread, Thread.new(:to_s, &Class.new.method(:undef_method)).join, bug5083) assert_instance_of(Thread, Thread.new(:to_s, &Class.new.method(:undef_method)).join, bug5083)
@ -1256,7 +1256,7 @@ q.pop
end if Process.respond_to?(:fork) end if Process.respond_to?(:fork)
def test_fork_while_parent_locked def test_fork_while_parent_locked
skip 'needs fork' unless Process.respond_to?(:fork) omit 'needs fork' unless Process.respond_to?(:fork)
m = Thread::Mutex.new m = Thread::Mutex.new
nr = 1 nr = 1
thrs = [] thrs = []
@ -1277,7 +1277,7 @@ q.pop
end end
def test_fork_while_mutex_locked_by_forker def test_fork_while_mutex_locked_by_forker
skip 'needs fork' unless Process.respond_to?(:fork) omit 'needs fork' unless Process.respond_to?(:fork)
m = Thread::Mutex.new m = Thread::Mutex.new
m.synchronize do m.synchronize do
pid = fork do pid = fork do
@ -1345,7 +1345,7 @@ q.pop
end end
def test_thread_native_thread_id def test_thread_native_thread_id
skip "don't support native_thread_id" unless Thread.method_defined?(:native_thread_id) omit "don't support native_thread_id" unless Thread.method_defined?(:native_thread_id)
assert_instance_of Integer, Thread.main.native_thread_id assert_instance_of Integer, Thread.main.native_thread_id
th1 = Thread.start{sleep} th1 = Thread.start{sleep}
@ -1384,7 +1384,7 @@ q.pop
def test_signal_at_join def test_signal_at_join
if /mswin|mingw/ =~ RUBY_PLATFORM if /mswin|mingw/ =~ RUBY_PLATFORM
skip "can't trap a signal from another process on Windows" omit "can't trap a signal from another process on Windows"
# opt = {new_pgroup: true} # opt = {new_pgroup: true}
end end
assert_separately([], "#{<<~"{#"}\n#{<<~'};'}", timeout: 120) assert_separately([], "#{<<~"{#"}\n#{<<~'};'}", timeout: 120)

View File

@ -580,10 +580,10 @@ class TestThreadQueue < Test::Unit::TestCase
def test_queue_with_trap def test_queue_with_trap
if ENV['APPVEYOR'] == 'True' && RUBY_PLATFORM.match?(/mswin/) if ENV['APPVEYOR'] == 'True' && RUBY_PLATFORM.match?(/mswin/)
skip 'This test fails too often on AppVeyor vs140' omit 'This test fails too often on AppVeyor vs140'
end end
if RUBY_PLATFORM.match?(/mingw/) if RUBY_PLATFORM.match?(/mingw/)
skip 'This test fails too often on MinGW' omit 'This test fails too often on MinGW'
end end
assert_in_out_err([], <<-INPUT, %w(INT INT exit), []) assert_in_out_err([], <<-INPUT, %w(INT INT exit), [])

View File

@ -116,7 +116,7 @@ class TestTime < Test::Unit::TestCase
assert_equal(946684800, Time.utc(2000, 1, 1, 0, 0, 0).tv_sec) assert_equal(946684800, Time.utc(2000, 1, 1, 0, 0, 0).tv_sec)
# Giveup to try 2nd test because some state is changed. # Giveup to try 2nd test because some state is changed.
skip if Test::Unit::Runner.current_repeat_count > 0 omit if Test::Unit::Runner.current_repeat_count > 0
assert_equal(0x7fffffff, Time.utc(2038, 1, 19, 3, 14, 7).tv_sec) assert_equal(0x7fffffff, Time.utc(2038, 1, 19, 3, 14, 7).tv_sec)
assert_equal(0x80000000, Time.utc(2038, 1, 19, 3, 14, 8).tv_sec) assert_equal(0x80000000, Time.utc(2038, 1, 19, 3, 14, 8).tv_sec)
@ -1183,7 +1183,7 @@ class TestTime < Test::Unit::TestCase
def test_2038 def test_2038
# Giveup to try 2nd test because some state is changed. # Giveup to try 2nd test because some state is changed.
skip if Test::Unit::Runner.current_repeat_count > 0 omit if Test::Unit::Runner.current_repeat_count > 0
if no_leap_seconds? if no_leap_seconds?
assert_equal(0x80000000, Time.utc(2038, 1, 19, 3, 14, 8).tv_sec) assert_equal(0x80000000, Time.utc(2038, 1, 19, 3, 14, 8).tv_sec)
@ -1308,8 +1308,8 @@ class TestTime < Test::Unit::TestCase
def test_memsize def test_memsize
# Time objects are common in some code, try to keep them small # Time objects are common in some code, try to keep them small
skip "Time object size test" if /^(?:i.?86|x86_64)-linux/ !~ RUBY_PLATFORM omit "Time object size test" if /^(?:i.?86|x86_64)-linux/ !~ RUBY_PLATFORM
skip "GC is in debug" if GC::INTERNAL_CONSTANTS[:DEBUG] omit "GC is in debug" if GC::INTERNAL_CONSTANTS[:DEBUG]
require 'objspace' require 'objspace'
t = Time.at(0) t = Time.at(0)
size = GC::INTERNAL_CONSTANTS[:RVALUE_SIZE] size = GC::INTERNAL_CONSTANTS[:RVALUE_SIZE]
@ -1323,6 +1323,6 @@ class TestTime < Test::Unit::TestCase
end end
assert_equal expect, ObjectSpace.memsize_of(t) assert_equal expect, ObjectSpace.memsize_of(t)
rescue LoadError => e rescue LoadError => e
skip "failed to load objspace: #{e.message}" omit "failed to load objspace: #{e.message}"
end end
end end

View File

@ -112,7 +112,7 @@ class TestTimeTZ < Test::Unit::TestCase
t = with_tz("America/Los_Angeles") { t = with_tz("America/Los_Angeles") {
Time.local(2000, 1, 1) Time.local(2000, 1, 1)
} }
skip "force_tz_test is false on this environment" unless t omit "force_tz_test is false on this environment" unless t
z1 = t.zone z1 = t.zone
z2 = with_tz(tz="Asia/Singapore") { z2 = with_tz(tz="Asia/Singapore") {
t.localtime.zone t.localtime.zone

View File

@ -3,7 +3,7 @@ require 'test/unit'
class TestVMDump < Test::Unit::TestCase class TestVMDump < Test::Unit::TestCase
def assert_darwin_vm_dump_works(args) def assert_darwin_vm_dump_works(args)
skip if RUBY_PLATFORM !~ /darwin/ omit if RUBY_PLATFORM !~ /darwin/
assert_in_out_err(args, "", [], /^\[IMPORTANT\]/) assert_in_out_err(args, "", [], /^\[IMPORTANT\]/)
end end