From 922e7141e30fc0ef5fc973716fab20a272531300 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 8 Feb 2014 03:28:49 -0500 Subject: test: log skipped tests on non-Linux systems --- test/test_buffer_tmpdir.rb | 10 ++++++++-- test/test_mt_accept.rb | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'test') diff --git a/test/test_buffer_tmpdir.rb b/test/test_buffer_tmpdir.rb index c7665f6..8461346 100644 --- a/test/test_buffer_tmpdir.rb +++ b/test/test_buffer_tmpdir.rb @@ -9,12 +9,18 @@ class TestBufferTmpdir < Testcase attr_reader :ino, :tmpdir def setup - @ino = SleepyPenguin::Inotify.new(:CLOEXEC) + @ino = nil + begin + @ino = SleepyPenguin::Inotify.new(:CLOEXEC) + rescue + skip "test needs inotify" + end @tmpdir = Dir.mktmpdir server_helper_setup end def teardown + return unless @ino server_helper_teardown @ino.close FileUtils.rm_rf @tmpdir @@ -100,4 +106,4 @@ class TestBufferTmpdir < Testcase c.close if c quit_wait(pid) end -end if SleepyPenguin.const_defined?(:Inotify) +end diff --git a/test/test_mt_accept.rb b/test/test_mt_accept.rb index e006af8..37813d4 100644 --- a/test/test_mt_accept.rb +++ b/test/test_mt_accept.rb @@ -10,6 +10,8 @@ class TestMtAccept < Testcase alias teardown server_helper_teardown def test_mt_accept + skip "Linux kernel required" unless RUBY_PLATFORM =~ /linux/ + skip "/proc not mounted" unless File.directory?("/proc") err, cfg, host, port = @err, Yahns::Config.new, @srv.addr[3], @srv.addr[1] opts = { threads: 1 } cfg.instance_eval do @@ -45,4 +47,4 @@ class TestMtAccept < Testcase ensure quit_wait(pid) end -end if RUBY_PLATFORM =~ /linux/ && File.directory?("/proc") +end -- cgit v1.2.3-24-ge0c7