* lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
ignore tests which raised LoadError. * test/drb/drbtest.rb, test/ruby/test_beginendblock.rb, test/ruby/test_system.rb: avoid requiring same file twice. * test/drb/test_drbssl.rb, test/drb/test_drbunix.rb: should not use ARGV unless invoked directly. do not create test cases unless required libraries are available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4650c38d8b
commit
f136a3225e
12
ChangeLog
12
ChangeLog
@ -1,3 +1,15 @@
|
|||||||
|
Wed Oct 22 12:53:31 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/test/unit/collector/dir.rb (Test::Unit::Collector::Dir#collect_file):
|
||||||
|
ignore tests which raised LoadError.
|
||||||
|
|
||||||
|
* test/drb/drbtest.rb, test/ruby/test_beginendblock.rb,
|
||||||
|
test/ruby/test_system.rb: avoid requiring same file twice.
|
||||||
|
|
||||||
|
* test/drb/test_drbssl.rb, test/drb/test_drbunix.rb: should not use
|
||||||
|
ARGV unless invoked directly. do not create test cases unless
|
||||||
|
required libraries are available.
|
||||||
|
|
||||||
Wed Oct 22 02:31:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Wed Oct 22 02:31:34 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* eval.c (ruby_cleanup): should not ignore exit_value in END
|
* eval.c (ruby_cleanup): should not ignore exit_value in END
|
||||||
|
@ -75,6 +75,7 @@ module Test
|
|||||||
require(name)
|
require(name)
|
||||||
end
|
end
|
||||||
find_test_cases(already_gathered).each{|t| add_suite(suites, t.suite)}
|
find_test_cases(already_gathered).each{|t| add_suite(suites, t.suite)}
|
||||||
|
rescue LoadError, SystemExit
|
||||||
ensure
|
ensure
|
||||||
$:.replace(loadpath)
|
$:.replace(loadpath)
|
||||||
end
|
end
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
require "#{File.dirname(File.expand_path(__FILE__))}/drbtest"
|
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'drb/drb'
|
require 'drb/drb'
|
||||||
require 'drb/extservm'
|
require 'drb/extservm'
|
||||||
require 'timeout'
|
require 'timeout'
|
||||||
|
$:.unshift(File.expand_path("../../ruby", __FILE__))
|
||||||
require "#{File.dirname(File.expand_path(__FILE__))}/../ruby/envutil"
|
require 'envutil'
|
||||||
|
|
||||||
class DRbService
|
class DRbService
|
||||||
@@manager = DRb::ExtServManager.new
|
@@manager = DRb::ExtServManager.new
|
||||||
@ -68,11 +67,11 @@ module DRbCore
|
|||||||
ro = DRbObject.new(nil, 'druby://localhost:12345')
|
ro = DRbObject.new(nil, 'druby://localhost:12345')
|
||||||
assert_equal('druby://localhost:12345', ro.__drburi)
|
assert_equal('druby://localhost:12345', ro.__drburi)
|
||||||
assert_equal(nil, ro.__drbref)
|
assert_equal(nil, ro.__drbref)
|
||||||
|
|
||||||
ro = DRbObject.new_with_uri('druby://localhost:12345')
|
ro = DRbObject.new_with_uri('druby://localhost:12345')
|
||||||
assert_equal('druby://localhost:12345', ro.__drburi)
|
assert_equal('druby://localhost:12345', ro.__drburi)
|
||||||
assert_equal(nil, ro.__drbref)
|
assert_equal(nil, ro.__drbref)
|
||||||
|
|
||||||
ro = DRbObject.new_with_uri('druby://localhost:12345?foobar')
|
ro = DRbObject.new_with_uri('druby://localhost:12345?foobar')
|
||||||
assert_equal('druby://localhost:12345', ro.__drburi)
|
assert_equal('druby://localhost:12345', ro.__drburi)
|
||||||
assert_equal(DRb::DRbURIOption.new('foobar'), ro.__drbref)
|
assert_equal(DRb::DRbURIOption.new('foobar'), ro.__drbref)
|
||||||
@ -88,7 +87,7 @@ module DRbCore
|
|||||||
|
|
||||||
def test_01_02_loop
|
def test_01_02_loop
|
||||||
onecky = Onecky.new('3')
|
onecky = Onecky.new('3')
|
||||||
50.times do
|
50.times do
|
||||||
assert_equal(6, @there.sample(onecky, 1, 2))
|
assert_equal(6, @there.sample(onecky, 1, 2))
|
||||||
ary = @there.to_a
|
ary = @there.to_a
|
||||||
assert_kind_of(DRb::DRbObject, ary)
|
assert_kind_of(DRb::DRbObject, ary)
|
||||||
@ -166,14 +165,14 @@ module DRbCore
|
|||||||
begin
|
begin
|
||||||
@there.method_missing(:eval)
|
@there.method_missing(:eval)
|
||||||
rescue NameError
|
rescue NameError
|
||||||
assert_match(/^private method `eval'/, $!.message)
|
assert_match(/^private method \`eval\'/, $!.message)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
assert_nothing_raised() {
|
assert_nothing_raised() {
|
||||||
begin
|
begin
|
||||||
@there.method_missing(:undefined_method_test)
|
@there.method_missing(:undefined_method_test)
|
||||||
rescue NameError
|
rescue NameError
|
||||||
assert_match(/^undefined method `undefined_method_test'/, $!.message)
|
assert_match(/^undefined method \`undefined_method_test\'/, $!.message)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
assert_raises(SecurityError) do
|
assert_raises(SecurityError) do
|
||||||
@ -184,7 +183,7 @@ module DRbCore
|
|||||||
def test_08_here
|
def test_08_here
|
||||||
ro = DRbObject.new(nil, DRb.uri)
|
ro = DRbObject.new(nil, DRb.uri)
|
||||||
assert_kind_of(String, ro.to_s)
|
assert_kind_of(String, ro.to_s)
|
||||||
|
|
||||||
ro = DRbObject.new_with_uri(DRb.uri)
|
ro = DRbObject.new_with_uri(DRb.uri)
|
||||||
assert_kind_of(String, ro.to_s)
|
assert_kind_of(String, ro.to_s)
|
||||||
end
|
end
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
require "#{File.dirname(File.expand_path(__FILE__))}/drbtest"
|
$:.unshift(File.dirname(File.expand_path(__FILE__)))
|
||||||
|
require 'drbtest'
|
||||||
|
|
||||||
class TestDRbCore < Test::Unit::TestCase
|
class TestDRbCore < Test::Unit::TestCase
|
||||||
include DRbCore
|
include DRbCore
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
require "#{File.dirname(File.expand_path(__FILE__))}/drbtest"
|
$:.unshift(File.dirname(File.expand_path(__FILE__)))
|
||||||
|
require 'drbtest'
|
||||||
require 'drb/ssl'
|
require 'drb/ssl'
|
||||||
|
|
||||||
class DRbSSLService < DRbService
|
class DRbSSLService < DRbService
|
||||||
@ -22,7 +23,8 @@ class DRbSSLService < DRbService
|
|||||||
[ ["C","JP"], ["O","Foo.DRuby.Org"], ["CN", "Sample"] ]
|
[ ["C","JP"], ["O","Foo.DRuby.Org"], ["CN", "Sample"] ]
|
||||||
end
|
end
|
||||||
|
|
||||||
@server = DRb::DRbServer.new(ARGV.shift || 'drbssl://:0', @@manager, config)
|
uri = ARGV.shift if $0 == __FILE__
|
||||||
|
@server = DRb::DRbServer.new(uri || 'drbssl://:0', @@manager, config)
|
||||||
end
|
end
|
||||||
|
|
||||||
class TestDRbSSLCore < Test::Unit::TestCase
|
class TestDRbSSLCore < Test::Unit::TestCase
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
require "#{File.dirname(File.expand_path(__FILE__))}/drbtest"
|
$:.unshift(File.dirname(File.expand_path(__FILE__)))
|
||||||
|
require 'drbtest'
|
||||||
require 'drb/unix'
|
require 'drb/unix'
|
||||||
|
|
||||||
class DRbUNIXService < DRbService
|
class DRbUNIXService < DRbService
|
||||||
%w(ut_drb_drbunix.rb ut_array_drbunix.rb).each do |nm|
|
%w(ut_drb_drbunix.rb ut_array_drbunix.rb).each do |nm|
|
||||||
DRb::ExtServManager.command[nm] = "#{@@ruby} #{@@dir}/#{nm}"
|
DRb::ExtServManager.command[nm] = "#{@@ruby} #{@@dir}/#{nm}"
|
||||||
end
|
end
|
||||||
@server = DRb::DRbServer.new(ARGV.shift || 'drbunix:', @@manager, {})
|
|
||||||
|
uri = ARGV.shift if $0 == __FILE__
|
||||||
|
@server = DRb::DRbServer.new(uri || 'drbunix:', @@manager, {})
|
||||||
end
|
end
|
||||||
|
|
||||||
class TestDRbUNIXCore < Test::Unit::TestCase
|
class TestDRbUNIXCore < Test::Unit::TestCase
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require 'tempfile'
|
require 'tempfile'
|
||||||
require "#{File.dirname(File.expand_path(__FILE__))}/envutil"
|
$:.unshift(File.dirname(File.expand_path(__FILE__)))
|
||||||
|
require 'envutil'
|
||||||
|
|
||||||
class TestBeginEndBlock < Test::Unit::TestCase
|
class TestBeginEndBlock < Test::Unit::TestCase
|
||||||
DIR = File.dirname(File.expand_path(__FILE__))
|
DIR = File.dirname(File.expand_path(__FILE__))
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
require "#{File.dirname(File.expand_path(__FILE__))}/envutil"
|
$:.unshift(File.dirname(File.expand_path(__FILE__)))
|
||||||
|
require 'envutil'
|
||||||
|
|
||||||
$KCODE = 'none'
|
$KCODE = 'none'
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user