ruby-changes:46294
From: usa <ko1@a...>
Date: Thu, 20 Apr 2017 10:36:17 +0900 (JST)
Subject: [ruby-changes:46294] usa:r58407 (trunk): Move test_extlibs.rb because it's not the test of ruby itself
usa 2017-04-20 10:36:11 +0900 (Thu, 20 Apr 2017) New Revision: 58407 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58407 Log: Move test_extlibs.rb because it's not the test of ruby itself * test/test_extlibs.rb: moved from test/ruby. Added files: trunk/test/test_extlibs.rb Removed files: trunk/test/ruby/test_extlibs.rb Index: test/ruby/test_extlibs.rb =================================================================== --- test/ruby/test_extlibs.rb (revision 58406) +++ test/ruby/test_extlibs.rb (nonexistent) @@ -1,85 +0,0 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_extlibs.rb#L0 -# frozen_string_literal: false -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 - assert_separately([], <<-"end;", ignore_stderr: true) # do - log = #{log.dump} - msg = proc { - "extension library `#{ext}' is not found#{add_msg}\n" << - (File.exist?(log) ? File.binread(log) : "\#{log} not found") - } - assert_nothing_raised(msg) do - require "#{ext}" - end - end; - end - end - - def windows? - /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" - 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" - check_existence "mathn/complex" - check_existence "mathn/rational" - 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" - 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" - check_existence "thread" - check_existence "Win32API" - check_existence "win32ole" - check_existence "zlib", "this may be false positive, but should assert because rubygems requires this" -end Property changes on: test/ruby/test_extlibs.rb ___________________________________________________________________ Deleted: svn:eol-style ## -1 +0,0 ## -LF \ No newline at end of property Index: test/test_extlibs.rb =================================================================== --- test/test_extlibs.rb (nonexistent) +++ test/test_extlibs.rb (revision 58407) @@ -0,0 +1,85 @@ https://github.com/ruby/ruby/blob/trunk/test/test_extlibs.rb#L1 +# frozen_string_literal: false +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 + assert_separately([], <<-"end;", ignore_stderr: true) # do + log = #{log.dump} + msg = proc { + "extension library `#{ext}' is not found#{add_msg}\n" << + (File.exist?(log) ? File.binread(log) : "\#{log} not found") + } + assert_nothing_raised(msg) do + require "#{ext}" + end + end; + end + end + + def windows? + /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" + 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" + check_existence "mathn/complex" + check_existence "mathn/rational" + 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" + 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" + check_existence "thread" + check_existence "Win32API" + check_existence "win32ole" + check_existence "zlib", "this may be false positive, but should assert because rubygems requires this" +end Property changes on: test/test_extlibs.rb ___________________________________________________________________ Added: svn:eol-style ## -0,0 +1 ## +LF \ No newline at end of property -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/