ruby-changes:28095
From: nobu <ko1@a...>
Date: Sat, 6 Apr 2013 09:59:25 +0900 (JST)
Subject: [ruby-changes:28095] nobu:r40147 (trunk): * test/dtrace/helper.rb (DTrace::TestCase#trap_probe): needs to pass
nobu 2013-04-06 09:59:12 +0900 (Sat, 06 Apr 2013) New Revision: 40147 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40147 Log: * test/dtrace/helper.rb (DTrace::TestCase#trap_probe): needs to pass some paths by environment variables. Modified files: trunk/test/dtrace/helper.rb Index: test/dtrace/helper.rb =================================================================== --- test/dtrace/helper.rb (revision 40146) +++ test/dtrace/helper.rb (revision 40147) @@ -13,7 +13,7 @@ end https://github.com/ruby/ruby/blob/trunk/test/dtrace/helper.rb#L13 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 https://github.com/ruby/ruby/blob/trunk/test/dtrace/helper.rb#L28 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/