summaryrefslogtreecommitdiff
path: root/test/ruby/test_extlibs.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-08 03:08:37 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-08 03:08:37 +0000
commit53662a711f616826be4ca8c9ebc74ba2f70102c1 (patch)
tree21ddf45e96be75dd493f81a57c707c45420cfff1 /test/ruby/test_extlibs.rb
parent65f2103b46508ee01e5e5db1d872b82f299d6247 (diff)
test_extlibs.rb: skip excluded libraries
* test/ruby/test_extlibs.rb (TestExtLibs.check_existence): ignore tests for explicitly excluded libraries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49890 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 7f8f033..71dcf2b 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