Bug #3452
closedENV 'make' is not considered in the rubygems test.
Description
=begin
Hi, Eric
the test fails follows.
$make=which make
ruby test/rubygems/test_gem_ext_configure_builder.rb
- Failure:
test_self_build(TestGemExtConfigureBuilder) [test/rubygems/test_gem_ext_configure_builder.rb:33]:
Expected "make", not "/usr/bin/make". - Failure:
test_self_build_has_makefile(TestGemExtConfigureBuilder) [test/rubygems/test_gem_ext_configure_builder.rb:79]:
Expected "make", not "/usr/bin/make".
on Windows,
nmake install test-all
also fails.
because defined MAKE by 'install' target, and environment's variable name is not case-sensitive on Windows.
I have some questions.
-
Is it intentional to use not ENV['MAKE'] but ENV['make'] at rubygems/ext/builder.rb ?
-
What do you want to test by test_self_build, test_self_build_has_makefile, test_class_build and test_clas_make?
Is it necessary to check make command?
If you think that, you should do unsetenv or check ENV.
I think that the redefine of MAKE at 'make install' is wrong, but it is another problem.
=end
Updated by tarui (Masaya Tarui) over 14 years ago
- Status changed from Open to Closed
=begin
ruby-core向けでチケットを作り直したので、こちらは閉じます。
=end
Updated by tarui (Masaya Tarui) over 14 years ago
- Status changed from Closed to Assigned
=begin
=end
Updated by mame (Yusuke Endoh) over 14 years ago
- Category set to lib
- Assignee changed from drbrain (Eric Hodel) to tarui (Masaya Tarui)
=begin
Hi,
How about this patch?
If it works, please commit it.
If not, please fix and commit it :-)
diff --git a/test/rubygems/gemutilities.rb b/test/rubygems/gemutilities.rb
index f1b0f75..803cd26 100644
--- a/test/rubygems/gemutilities.rb
+++ b/test/rubygems/gemutilities.rb
@@ -474,7 +474,7 @@ Also, a list:
# other platforms, including Cygwin, it will return 'make'.
#
def self.make_command
- vc_windows? ? 'nmake' : 'make'
- ENV["make"] || (vc_windows? ? 'nmake' : 'make')
end
# Returns the make command for the current platform. For versions of Ruby
@@ -482,7 +482,7 @@ Also, a list:
# other platforms, including Cygwin, it will return 'make'.
#
def make_command
- vc_windows? ? 'nmake' : 'make'
- ENV["make"] || (vc_windows? ? 'nmake' : 'make')
end
# Returns whether or not the nmake command could be found.
diff --git a/test/rubygems/test_gem_ext_configure_builder.rb b/test/rubygems/test_gem_ext_configure_builder.rb
index 451aa4c..c484203 100644
--- a/test/rubygems/test_gem_ext_configure_builder.rb
+++ b/test/rubygems/test_gem_ext_configure_builder.rb
@@ -30,9 +30,9 @@ class TestGemExtConfigureBuilder < RubyGemTestCase
assert_equal "sh ./configure --prefix=#{@dest_path}", output.shift
assert_equal "", output.shift
- assert_equal "make", output.shift
- assert_equal make_command, output.shift
assert_match(/^ok$/m, output.shift)
- assert_equal "make install", output.shift
- assert_equal make_command + " install", output.shift
assert_match(/^ok$/m, output.shift)
end
diff --git a/test/rubygems/test_gem_ext_ext_conf_builder.rb b/test/rubygems/test_gem_ext_ext_conf_builder.rb
index 84af073..d9483df 100644
--- a/test/rubygems/test_gem_ext_ext_conf_builder.rb
+++ b/test/rubygems/test_gem_ext_ext_conf_builder.rb
@@ -39,14 +39,8 @@ class TestGemExtExtConfBuilder < RubyGemTestCase
assert_match(/^#{Gem.ruby} extconf.rb/, output[0])
assert_equal "creating Makefile\n", output[1]
- case RUBY_PLATFORM
- when /mswin/ then
-
assert_equal "nmake", output[2]
-
assert_equal "nmake install", output[4]
- else
-
assert_equal "make", output[2]
-
assert_equal "make install", output[4]
- end
- assert_equal make_command, output[2]
- assert_equal make_command + " install", output[4]
end
def test_class_build_extconf_fail
--
Yusuke Endoh mame@tsg.ne.jp
=end
Updated by tarui (Masaya Tarui) over 14 years ago
- Status changed from Assigned to Closed
=begin
I committed the fix as r28461.
By the way, does no one worry about the following doubt?
- Is it intentional to use not ENV['MAKE'] but ENV['make'] at rubygems/ext/builder.rb ?
=end