summaryrefslogtreecommitdiff
path: root/test/ruby/test_extlibs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_extlibs.rb')
-rw-r--r--test/ruby/test_extlibs.rb24
1 files changed, 20 insertions, 4 deletions
diff --git a/test/ruby/test_extlibs.rb b/test/ruby/test_extlibs.rb
index 7f8f033eca..71dcf2b133 100644
--- a/test/ruby/test_extlibs.rb
+++ b/test/ruby/test_extlibs.rb
@@ -1,9 +1,11 @@
require "envutil"
+require "shellwords"
class TestExtLibs < Test::Unit::TestCase
@extdir = $".grep(/\/rbconfig\.rb\z/) {break "#$`/ext"}
def self.check_existence(ext, add_msg = nil)
+ return if @excluded.any? {|i| File.fnmatch?(i, ext, File::FNM_CASEFOLD)}
add_msg = ". #{add_msg}" if add_msg
log = "#{@extdir}/#{ext}/mkmf.log"
define_method("test_existence_of_#{ext}") do
@@ -24,6 +26,20 @@ class TestExtLibs < Test::Unit::TestCase
/mswin|mingw/ =~ RUBY_PLATFORM
end
+ excluded = [RbConfig::CONFIG, ENV].map do |conf|
+ if args = conf['configure_args']
+ args.shellsplit.grep(/\A--without-ext=/) {$'.split(/,/)}
+ end
+ end.flatten.compact
+ excluded << '+' if excluded.empty?
+ if windows?
+ excluded.map! {|i| i == '+' ? ['pty', 'syslog'] : i}
+ excluded.flatten!
+ else
+ excluded.map! {|i| i == '+' ? '*win32*' : i}
+ end
+ @excluded = excluded
+
check_existence "bigdecimal"
check_existence "continuation"
check_existence "coverage"
@@ -51,7 +67,7 @@ class TestExtLibs < Test::Unit::TestCase
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 "pty"
check_existence "racc/cparse"
check_existence "rbconfig/sizeof"
#check_existence "readline" # depend on libreadline
@@ -60,11 +76,11 @@ class TestExtLibs < Test::Unit::TestCase
check_existence "socket"
check_existence "stringio"
check_existence "strscan"
- check_existence "syslog" unless windows?
+ check_existence "syslog"
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 "Win32API"
+ check_existence "win32ole"
check_existence "zlib", "this may be false positive, but should assert because rubygems requires this"
end