зеркало из https://github.com/github/ruby.git
test_extlibs.rb: show mkmf.log
* test/ruby/test_extlibs.rb (check_existence): show mkmf.log of failed extension libraries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
64241b0921
Коммит
8b5c69fa97
|
@ -1,11 +1,19 @@
|
|||
require "envutil"
|
||||
|
||||
class TestExtLibs < Test::Unit::TestCase
|
||||
@extdir = $".grep(/\/rbconfig\.rb\z/) {break "#$`/ext"}
|
||||
|
||||
def self.check_existence(ext, add_msg = nil)
|
||||
add_msg = ". #{add_msg}" if add_msg
|
||||
log = "#{@extdir}/#{ext}/mkmf.log"
|
||||
define_method("test_existence_of_#{ext}") do
|
||||
assert_separately([], <<-"end;", ignore_stderr: true) # do
|
||||
assert_nothing_raised("extension library `#{ext}' is not found#{add_msg}") do
|
||||
log = #{log.dump}
|
||||
msg = proc {
|
||||
"extension library `#{ext}' is not found#{add_msg}\n" <<
|
||||
(File.exist?(log) ? File.read(log) : "\#{log} not found")
|
||||
}
|
||||
assert_nothing_raised(msg) do
|
||||
require "#{ext}"
|
||||
end
|
||||
end;
|
||||
|
|
Загрузка…
Ссылка в новой задаче