1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 54086,54211,54233: [Backport #12199]

* test/lib/test/unit.rb (Options#non_options): make regexp name
	  options prefixed with "!" negative filters.

	* common.mk (TEST_EXCLUDES): use negative filter to exclude memory
	  leak tests.  -x option excludes test files, not test methods.

	* common.mk (TEST_EXCLUDES, EXCLUDE_TESTFRAMEWORK): use full spell
	  long option.

	* cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL): suppress path name
	  conversions by msys2.  [ruby-dev:49525] [Bug #12199]

	* cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL_PARAM):
	  * add missing parentheses and remove double quotes.
	  * rename to get rid of recursive references.
	  * as --excludes-dir option is for a path name, its argument
	    should be converted.
	  [ruby-dev:49526] [Bug #12199]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2016-04-18 04:57:25 +00:00
parent b118f5d82f
commit ffcad81c19
5 changed files with 63 additions and 9 deletions

View file

@ -1,3 +1,28 @@
Mon Apr 18 13:48:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL_PARAM):
* add missing parentheses and remove double quotes.
* rename to get rid of recursive references.
* as --excludes-dir option is for a path name, its argument
should be converted.
[ruby-dev:49526] [Bug #12199]
Mon Apr 18 13:48:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* common.mk (TEST_EXCLUDES, EXCLUDE_TESTFRAMEWORK): use full spell
long option.
* cygwin/GNUmakefile.in (MSYS2_ARG_CONV_EXCL): suppress path name
conversions by msys2. [ruby-dev:49525] [Bug #12199]
Mon Apr 18 13:48:05 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/lib/test/unit.rb (Options#non_options): make regexp name
options prefixed with "!" negative filters.
* common.mk (TEST_EXCLUDES): use negative filter to exclude memory
leak tests. -x option excludes test files, not test methods.
Sun Apr 17 04:30:13 2016 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (parse_ident): allow keyword arguments just after a

View file

@ -153,8 +153,8 @@ PRE_LIBRUBY_UPDATE = $(MINIRUBY) -e 'ARGV[1] or File.unlink(ARGV[0]) rescue nil'
$(LIBRUBY_EXTS) $(LIBRUBY_SO_UPDATE)
TESTSDIR = $(srcdir)/test
TEST_EXCLUDES = --excludes=$(TESTSDIR)/excludes -x /memory_leak/
EXCLUDE_TESTFRAMEWORK = -x /testunit/ -x /minitest/
TEST_EXCLUDES = --excludes-dir=$(TESTSDIR)/excludes --name=!/memory_leak/
EXCLUDE_TESTFRAMEWORK = --exclude=/testunit/ --exclude=/minitest/
TESTWORKDIR = testwork
TESTOPTS = $(RUBY_TESTOPTS)

View file

@ -88,6 +88,13 @@ $(OBJS) $(MAINOBJ): win32.h
dir.$(OBJEXT) win32/win32.$(OBJEXT): win32/dir.h
file.$(OBJEXT) win32/win32.$(OBJEXT): win32/file.h
MSYS2_ARG_CONV_EXCL_PARAM = --exclude=;--name=
yes-test-ruby: export MSYS2_ARG_CONV_EXCL=$(MSYS2_ARG_CONV_EXCL_PARAM)
yes-test-all: export MSYS2_ARG_CONV_EXCL=$(MSYS2_ARG_CONV_EXCL_PARAM)
yes-test-almost: export MSYS2_ARG_CONV_EXCL=$(MSYS2_ARG_CONV_EXCL_PARAM)
endif
$(LIBRUBY_SO): $(RUBYDEF)

View file

@ -87,7 +87,7 @@ module Test
end
opts.on '-n', '--name PATTERN', "Filter test method names on pattern: /REGEXP/ or STRING" do |a|
options[:filter] = a
(options[:filter] ||= []) << a
end
opts.on '--test-order=random|alpha|sorted', [:random, :alpha, :sorted] do |a|
@ -96,6 +96,30 @@ module Test
end
def non_options(files, options)
filter = options[:filter]
if filter
pos_pat = /\A\/(.*)\/\z/
neg_pat = /\A!\/(.*)\/\z/
negative, positive = filter.partition {|s| neg_pat =~ s}
if positive.empty?
filter = nil
elsif negative.empty? and positive.size == 1 and pos_pat !~ positive[0]
filter = positive[0]
else
filter = Regexp.union(*positive.map! {|s| s[pos_pat, 1] || "\\A#{Regexp.quote(s)}\\z"})
end
unless negative.empty?
negative = Regexp.union(*negative.map! {|s| s[neg_pat, 1]})
filter = /\A(?!.*#{negative})#{filter}/
end
if Regexp === filter
# bypass conversion in minitest
def filter.=~(other) # :nodoc:
super unless Regexp === other
end
end
options[:filter] = filter
end
true
end
end
@ -589,9 +613,7 @@ module Test
@verbose = !options[:parallel]
@output = Output.new(self)
end
if /\A\/(.*)\/\z/ =~ (filter = options[:filter])
filter = Regexp.new($1)
end
filter = options[:filter]
type = "#{type}_methods"
total = if filter
suites.inject(0) {|n, suite| n + suite.send(type).grep(filter).size}

View file

@ -1,10 +1,10 @@
#define RUBY_VERSION "2.3.0"
#define RUBY_RELEASE_DATE "2016-04-17"
#define RUBY_PATCHLEVEL 85
#define RUBY_RELEASE_DATE "2016-04-18"
#define RUBY_PATCHLEVEL 86
#define RUBY_RELEASE_YEAR 2016
#define RUBY_RELEASE_MONTH 4
#define RUBY_RELEASE_DAY 17
#define RUBY_RELEASE_DAY 18
#include "ruby/version.h"