From 53662a711f616826be4ca8c9ebc74ba2f70102c1 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 8 Mar 2015 03:08:37 +0000 Subject: 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 --- test/ruby/test_extlibs.rb | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'test/ruby/test_extlibs.rb') 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 -- cgit v1.2.3