[前][次][番号順一覧][スレッド一覧]

ruby-changes:37809

From: nobu <ko1@a...>
Date: Sun, 8 Mar 2015 12:08:55 +0900 (JST)
Subject: [ruby-changes:37809] nobu:r49890 (trunk): test_extlibs.rb: skip excluded libraries

nobu	2015-03-08 12:08:37 +0900 (Sun, 08 Mar 2015)

  New Revision: 49890

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49890

  Log:
    test_extlibs.rb: skip excluded libraries
    
    * test/ruby/test_extlibs.rb (TestExtLibs.check_existence): ignore
      tests for explicitly excluded libraries.

  Modified files:
    trunk/test/ruby/test_extlibs.rb
Index: test/ruby/test_extlibs.rb
===================================================================
--- test/ruby/test_extlibs.rb	(revision 49889)
+++ test/ruby/test_extlibs.rb	(revision 49890)
@@ -1,9 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_extlibs.rb#L1
 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_extlibs.rb#L26
     /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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_extlibs.rb#L67
   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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_extlibs.rb#L76
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]