From 8ee121d060ed7b3191e86c981fe144be2e19953a Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 6 Apr 2013 00:59:12 +0000 Subject: * test/dtrace/helper.rb (DTrace::TestCase#trap_probe): needs to pass some paths by environment variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/dtrace/helper.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/dtrace/helper.rb b/test/dtrace/helper.rb index 7a327a8695..a462851dbf 100644 --- a/test/dtrace/helper.rb +++ b/test/dtrace/helper.rb @@ -13,7 +13,7 @@ end ok &= (`dtrace -V` rescue false) module DTrace class TestCase < MiniTest::Unit::TestCase - INCLUDE = File.expand_path(File.join(File.dirname(__FILE__), '..')) + INCLUDE = File.expand_path('..', File.dirname(__FILE__)) def trap_probe d_program, ruby_program d = Tempfile.new('probe.d') @@ -28,7 +28,14 @@ module DTrace rb_path = rb.path cmd = ["dtrace", "-q", "-s", d_path, "-c", "#{EnvUtil.rubybin} -I#{INCLUDE} #{rb_path}"] - sudo = ENV["SUDO"] and cmd.unshift(sudo) + if sudo = ENV["SUDO"] + [RbConfig::CONFIG["LIBPATHENV"], "RUBY", "RUBYOPT"].each do |name| + if name and val = ENV[name] + cmd.unshift("#{name}=#{val}") + end + end + cmd.unshift(sudo) + end probes = IO.popen(cmd) do |io| io.readlines end -- cgit v1.2.3