* test/{dbm,gdbm,sdbm}/test_{dbm,gdbm,sdbm}.rb: skip some tests

which using fork on fork-less platforms.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
usa 2005-07-04 02:24:54 +00:00
Родитель 507dd0e1b2
Коммит 60f2184922
4 изменённых файлов: 38 добавлений и 1 удалений

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

@ -1,3 +1,8 @@
Mon Jul 4 11:23:50 2005 NAKAMURA Usaku <usa@ruby-lang.org>
* test/{dbm,gdbm,sdbm}/test_{dbm,gdbm,sdbm}.rb: skip some tests
which using fork on fork-less platforms.
Sun Jul 3 23:26:30 2005 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp> Sun Jul 3 23:26:30 2005 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
* test/wsdl/document/test_rpc.rb: compare formatted time string of * test/wsdl/document/test_rpc.rb: compare formatted time string of
@ -8007,7 +8012,7 @@ Tue May 18 21:21:43 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
* CSV::Cell removed. a cell is represented as just a String or * CSV::Cell removed. a cell is represented as just a String or
nil(NULL). this change will cause widespread destruction. nil(NULL). this change will cause widespread destruction.
CSV.open("foo.csv", "r") do |row| CSV.open("foo.csv", "r") do |row|
row.each do |cell| row.each do |cell|
if cell.is_null # Cell#is_null if cell.is_null # Cell#is_null
p "(NULL)" p "(NULL)"

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

@ -61,6 +61,15 @@ if defined? DBM
end end
end end
def have_fork?
begin
fork{}
true
rescue NotImplementedError
false
end
end
def test_s_new_has_no_block def test_s_new_has_no_block
# DBM.new ignore the block # DBM.new ignore the block
foo = true foo = true
@ -77,6 +86,7 @@ if defined? DBM
assert_equal(DBM.open("tmptest_dbm") { :foo }, :foo) assert_equal(DBM.open("tmptest_dbm") { :foo }, :foo)
end end
def test_s_open_lock def test_s_open_lock
return unless have_fork? # snip this test
fork() { fork() {
assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644)) assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644))
sleep 2 sleep 2
@ -115,6 +125,7 @@ if defined? DBM
if not defined? DBM::NOLOCK if not defined? DBM::NOLOCK
return return
end end
return unless have_fork? # snip this test
fork() { fork() {
assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644, assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644,

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

@ -58,6 +58,15 @@ if defined? GDBM
end end
end end
def have_fork?
begin
fork{}
true
rescue NotImplementedError
false
end
end
def test_s_new_has_no_block def test_s_new_has_no_block
# GDBM.new ignore the block # GDBM.new ignore the block
foo = true foo = true
@ -108,6 +117,7 @@ if defined? GDBM
assert_equal(GDBM.open("tmptest_gdbm") { :foo }, :foo) assert_equal(GDBM.open("tmptest_gdbm") { :foo }, :foo)
end end
def test_s_open_lock def test_s_open_lock
return unless have_fork? # snip this test
fork() { fork() {
assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644)) assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644))
sleep 2 sleep 2
@ -146,6 +156,7 @@ if defined? GDBM
if not defined? GDBM::NOLOCK if not defined? GDBM::NOLOCK
return return
end end
return unless have_fork? # snip this test
fork() { fork() {
assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644, assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644,

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

@ -31,6 +31,15 @@ class TestSDBM < Test::Unit::TestCase
end end
end end
def have_fork?
begin
fork{}
true
rescue NotImplementedError
false
end
end
def test_version def test_version
assert(! SDBM.const_defined?(:VERSION)) assert(! SDBM.const_defined?(:VERSION))
end end
@ -70,6 +79,7 @@ class TestSDBM < Test::Unit::TestCase
if not defined? SDBM::NOLOCK if not defined? SDBM::NOLOCK
return return
end end
return unless have_fork? # snip this test
fork() { fork() {
assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm", 0644, assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm", 0644,