1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/envutil.rb, test/drb/drbtest.rb: can test drb

before install. (backported from HEAD) [ruby-Bugs-1672]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8428 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-05-12 00:07:50 +00:00
parent 353b5e9a5b
commit 6311ee1166
3 changed files with 21 additions and 9 deletions

View file

@ -2,21 +2,25 @@ require 'test/unit'
require 'drb/drb'
require 'drb/extservm'
require 'timeout'
require 'rbconfig'
DRb::DRbServer.new(nil)
begin
loadpath = $:.dup
$:.replace($: | [File.expand_path("../ruby", File.dirname(__FILE__))])
require 'envutil'
ensure
$:.replace(loadpath)
end
class DRbService
@@manager = DRb::ExtServManager.new
@@ruby = File.join(
Config::CONFIG["bindir"],
Config::CONFIG["ruby_install_name"] + Config::CONFIG["EXEEXT"]
)
@@ruby = EnvUtil.rubybin
@@ruby += " -d" if $DEBUG
@@dir = File.dirname(File.expand_path(__FILE__))
def self.add_service_command(nm)
dir = File.dirname(File.expand_path(__FILE__))
DRb::ExtServManager.command[nm] = "#{@@ruby} #{dir}/#{nm}"
end
%w(ut_drb.rb ut_array.rb ut_port.rb ut_large.rb ut_safe1.rb ut_eval.rb).each do |nm|
DRb::ExtServManager.command[nm] = "#{@@ruby} #{@@dir}/#{nm}"
add_service_command(nm)
end
@server = @@server = DRb::DRbServer.new(nil, @@manager, {})
@@manager.uri = @@server.uri