2014-12-25 20:57:32 -05:00
|
|
|
require "envutil"
|
|
|
|
|
2014-12-25 10:15:18 -05:00
|
|
|
class TestExtLibs < Test::Unit::TestCase
|
2014-12-28 09:04:26 -05:00
|
|
|
@extdir = $".grep(/\/rbconfig\.rb\z/) {break "#$`/ext"}
|
|
|
|
|
2014-12-25 18:20:52 -05:00
|
|
|
def self.check_existence(ext, add_msg = nil)
|
2014-12-25 10:15:18 -05:00
|
|
|
add_msg = ". #{add_msg}" if add_msg
|
2014-12-28 09:04:26 -05:00
|
|
|
log = "#{@extdir}/#{ext}/mkmf.log"
|
2014-12-25 20:57:32 -05:00
|
|
|
define_method("test_existence_of_#{ext}") do
|
|
|
|
assert_separately([], <<-"end;", ignore_stderr: true) # do
|
2014-12-28 09:04:26 -05:00
|
|
|
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
|
2014-12-25 20:57:32 -05:00
|
|
|
require "#{ext}"
|
|
|
|
end
|
|
|
|
end;
|
2014-12-25 10:15:18 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def windows?
|
|
|
|
/mswin|mingw/ =~ RUBY_PLATFORM
|
|
|
|
end
|
|
|
|
|
2014-12-25 18:20:52 -05:00
|
|
|
check_existence "bigdecimal"
|
|
|
|
check_existence "continuation"
|
|
|
|
check_existence "coverage"
|
|
|
|
check_existence "date"
|
|
|
|
#check_existence "dbm" # depend on libdbm
|
|
|
|
check_existence "digest"
|
|
|
|
check_existence "digest/bubblebabble"
|
|
|
|
check_existence "digest/md5"
|
|
|
|
check_existence "digest/rmd160"
|
|
|
|
check_existence "digest/sha1"
|
|
|
|
check_existence "digest/sha2"
|
|
|
|
check_existence "etc"
|
|
|
|
check_existence "fcntl"
|
|
|
|
check_existence "fiber"
|
|
|
|
check_existence "fiddle"
|
|
|
|
#check_existence "gdbm" # depend on libgdbm
|
|
|
|
check_existence "io/console"
|
|
|
|
check_existence "io/nonblock"
|
|
|
|
check_existence "io/wait"
|
|
|
|
check_existence "json"
|
2014-12-25 20:57:32 -05:00
|
|
|
check_existence "mathn/complex"
|
|
|
|
check_existence "mathn/rational"
|
2014-12-25 18:20:52 -05:00
|
|
|
check_existence "nkf"
|
|
|
|
check_existence "objspace"
|
|
|
|
check_existence "openssl", "this may be false positive, but should assert because rubygems requires this"
|
|
|
|
check_existence "pathname"
|
|
|
|
check_existence "psych"
|
|
|
|
check_existence "pty" unless windows?
|
|
|
|
check_existence "racc/cparse"
|
|
|
|
check_existence "rbconfig/sizeof"
|
|
|
|
#check_existence "readline" # depend on libreadline
|
|
|
|
check_existence "ripper"
|
|
|
|
check_existence "sdbm"
|
|
|
|
check_existence "socket"
|
|
|
|
check_existence "stringio"
|
|
|
|
check_existence "strscan"
|
|
|
|
check_existence "syslog" unless windows?
|
|
|
|
check_existence "thread"
|
|
|
|
#check_existence "tk" # depend on Tcl/Tk
|
|
|
|
#check_existence "tk/tkutil" # depend on Tcl/Tk
|
|
|
|
check_existence "Win32API" if windows?
|
|
|
|
check_existence "win32ole" if windows?
|
|
|
|
check_existence "zlib", "this may be false positive, but should assert because rubygems requires this"
|
2014-12-25 10:15:18 -05:00
|
|
|
end
|