Skip to content

Commit

Permalink
* test/{dbm,gdbm,sdbm}/test_{dbm,gdbm,sdbm}.rb: skip some tests
Browse files Browse the repository at this point in the history
  which using fork on fork-less platforms.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
unak committed Jul 4, 2005
1 parent 507dd0e commit 60f2184
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Mon Jul 4 11:23:50 2005 NAKAMURA Usaku <[email protected]>

* 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 <[email protected]>

* test/wsdl/document/test_rpc.rb: compare formatted time string of
Expand Down Expand Up @@ -8007,7 +8012,7 @@ Tue May 18 21:21:43 2004 NAKAMURA, Hiroshi <[email protected]>
* CSV::Cell removed. a cell is represented as just a String or
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|
if cell.is_null # Cell#is_null
p "(NULL)"
Expand Down
11 changes: 11 additions & 0 deletions test/dbm/test_dbm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ def check_size(expect, dbm=@dbm)
end
end

def have_fork?
begin
fork{}
true
rescue NotImplementedError
false
end
end

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

fork() {
assert_instance_of(DBM, dbm = DBM.open("tmptest_dbm", 0644,
Expand Down
11 changes: 11 additions & 0 deletions test/gdbm/test_gdbm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ def check_size(expect, gdbm=@gdbm)
end
end

def have_fork?
begin
fork{}
true
rescue NotImplementedError
false
end
end

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

fork() {
assert_instance_of(GDBM, gdbm = GDBM.open("tmptest_gdbm", 0644,
Expand Down
10 changes: 10 additions & 0 deletions test/sdbm/test_sdbm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@ def check_size(expect, sdbm=@sdbm)
end
end

def have_fork?
begin
fork{}
true
rescue NotImplementedError
false
end
end

def test_version
assert(! SDBM.const_defined?(:VERSION))
end
Expand Down Expand Up @@ -70,6 +79,7 @@ def test_s_open_nolock
if not defined? SDBM::NOLOCK
return
end
return unless have_fork? # snip this test

fork() {
assert_instance_of(SDBM, sdbm = SDBM.open("tmptest_sdbm", 0644,
Expand Down

0 comments on commit 60f2184

Please sign in to comment.