ext_conf_builder.rb: use RUBYOPT
* lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build): use RUBYOPT instead of -r option, and revert some tests. [Bug #7698] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39559 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
c0c72c9ba1
commit
9b79ed1292
@ -1,4 +1,7 @@
|
|||||||
Sun Mar 3 01:14:28 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sun Mar 3 01:16:16 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
|
||||||
|
use RUBYOPT instead of -r option, and revert some tests. [Bug #7698]
|
||||||
|
|
||||||
* lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
|
* lib/rubygems/ext/ext_conf_builder.rb (Gem::Ext::ExtConfBuilder.build):
|
||||||
revert use of temporary directory for build, to work some buggy
|
revert use of temporary directory for build, to work some buggy
|
||||||
|
@ -22,7 +22,9 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|||||||
f
|
f
|
||||||
end
|
end
|
||||||
|
|
||||||
cmd = [Gem.ruby, "-r#{siteconf.path}", File.basename(extension), *args].join ' '
|
rubyopt = ENV["RUBYOPT"]
|
||||||
|
ENV["RUBYOPT"] = ["-r#{siteconf.path}", rubyopt].compact.join(' ')
|
||||||
|
cmd = [Gem.ruby, File.basename(extension), *args].join ' '
|
||||||
|
|
||||||
run cmd, results
|
run cmd, results
|
||||||
|
|
||||||
@ -30,6 +32,7 @@ class Gem::Ext::ExtConfBuilder < Gem::Ext::Builder
|
|||||||
|
|
||||||
results
|
results
|
||||||
ensure
|
ensure
|
||||||
|
ENV["RUBYOPT"] = rubyopt
|
||||||
siteconf.close(true) if siteconf
|
siteconf.close(true) if siteconf
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|||||||
Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
|
Gem::Ext::ExtConfBuilder.build 'extconf.rb', nil, @dest_path, output
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_match(/^#{Gem.ruby} .*extconf.rb/, output[0])
|
assert_match(/^#{Gem.ruby} extconf.rb/, output[0])
|
||||||
assert_equal "creating Makefile\n", output[1]
|
assert_equal "creating Makefile\n", output[1]
|
||||||
case RUBY_PLATFORM
|
case RUBY_PLATFORM
|
||||||
when /mswin/ then
|
when /mswin/ then
|
||||||
@ -107,10 +107,10 @@ class TestGemExtExtConfBuilder < Gem::TestCase
|
|||||||
|
|
||||||
assert_match(/\Aextconf failed:
|
assert_match(/\Aextconf failed:
|
||||||
|
|
||||||
#{Gem.ruby} .*extconf.rb.*
|
#{Gem.ruby} extconf.rb.*
|
||||||
checking for main\(\) in .*?nonexistent/m, error.message)
|
checking for main\(\) in .*?nonexistent/m, error.message)
|
||||||
|
|
||||||
assert_match(/^#{Gem.ruby} .*extconf.rb/, output[0])
|
assert_equal("#{Gem.ruby} extconf.rb", output[0])
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_class_make
|
def test_class_make
|
||||||
|
@ -81,7 +81,7 @@ load Gem.bin_path('a', 'executable', version)
|
|||||||
|
|
||||||
gem_make_out = File.join @gemhome, 'gems', @spec.full_name, 'gem_make.out'
|
gem_make_out = File.join @gemhome, 'gems', @spec.full_name, 'gem_make.out'
|
||||||
|
|
||||||
assert_match %r%#{Regexp.escape Gem.ruby} .*extconf\.rb%,
|
assert_match %r%#{Regexp.escape Gem.ruby} extconf\.rb%,
|
||||||
File.read(gem_make_out)
|
File.read(gem_make_out)
|
||||||
assert_match %r%#{Regexp.escape Gem.ruby}: No such file%,
|
assert_match %r%#{Regexp.escape Gem.ruby}: No such file%,
|
||||||
File.read(gem_make_out)
|
File.read(gem_make_out)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user