ruby-changes:47857
From: eregon <ko1@a...>
Date: Thu, 21 Sep 2017 04:45:25 +0900 (JST)
Subject: [ruby-changes:47857] eregon:r59977 (trunk): Update to ruby/spec@e3b6811
eregon 2017-09-21 04:45:19 +0900 (Thu, 21 Sep 2017) New Revision: 59977 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59977 Log: Update to ruby/spec@e3b6811 Added files: trunk/spec/rubyspec/library/date/next_day_spec.rb Modified files: trunk/spec/rubyspec/library/set/case_equality_spec.rb trunk/spec/rubyspec/library/set/sortedset/case_equality_spec.rb trunk/spec/rubyspec/optional/capi/ext/st_spec.c trunk/spec/rubyspec/optional/capi/spec_helper.rb Index: spec/rubyspec/library/date/next_day_spec.rb =================================================================== --- spec/rubyspec/library/date/next_day_spec.rb (nonexistent) +++ spec/rubyspec/library/date/next_day_spec.rb (revision 59977) @@ -0,0 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/library/date/next_day_spec.rb#L1 +require File.expand_path('../../../spec_helper', __FILE__) +require 'date' + +describe "Date#next_day" do + it "returns the next day" do + d = Date.new(2000, 1, 5) + d1 = Date.new(2000, 1, 4).next_day + d1.should == d + end +end Index: spec/rubyspec/library/set/case_equality_spec.rb =================================================================== --- spec/rubyspec/library/set/case_equality_spec.rb (revision 59976) +++ spec/rubyspec/library/set/case_equality_spec.rb (revision 59977) @@ -2,6 +2,8 @@ require File.expand_path('../../../spec_ https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/library/set/case_equality_spec.rb#L2 require File.expand_path('../shared/include', __FILE__) require 'set' -describe "Set#===" do - it_behaves_like :set_include, :=== +ruby_version_is "2.5" do + describe "Set#===" do + it_behaves_like :set_include, :=== + end end Index: spec/rubyspec/library/set/sortedset/case_equality_spec.rb =================================================================== --- spec/rubyspec/library/set/sortedset/case_equality_spec.rb (revision 59976) +++ spec/rubyspec/library/set/sortedset/case_equality_spec.rb (revision 59977) @@ -2,6 +2,8 @@ require File.expand_path('../../../../sp https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/library/set/sortedset/case_equality_spec.rb#L2 require File.expand_path('../shared/include', __FILE__) require 'set' -describe "SortedSet#===" do - it_behaves_like :sorted_set_include, :=== +ruby_version_is "2.5" do + describe "SortedSet#===" do + it_behaves_like :sorted_set_include, :=== + end end Index: spec/rubyspec/optional/capi/spec_helper.rb =================================================================== --- spec/rubyspec/optional/capi/spec_helper.rb (revision 59976) +++ spec/rubyspec/optional/capi/spec_helper.rb (revision 59977) @@ -55,25 +55,8 @@ def compile_extension(name) https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/spec_helper.rb#L55 $stderr.puts output if debug end - make = ENV['MAKE'] - make ||= (RbConfig::CONFIG['host_os'].include?("mswin") ? "nmake" : "make") - if File.basename(make, ".*").casecmp?("nmake") - # suppress logo of nmake.exe to stderr - ENV["MAKEFLAGS"] = "l#{ENV["MAKEFLAGS"]}" - end - - opts = {} - if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ ENV["MAKEFLAGS"] - begin - r = IO.for_fd($1.to_i(10), "rb", autoclose: false) - w = IO.for_fd($2.to_i(10), "wb", autoclose: false) - rescue Errno::EBADF - else - opts[r] = r - opts[w] = w - end - end # Do not capture stderr as we want to show compiler warnings + make, opts = setup_make output = IO.popen([make, "V=1", "DESTDIR=", opts], &:read) raise "#{make} failed:\n#{output}" unless $?.success? $stderr.puts output if debug @@ -88,6 +71,31 @@ def compile_extension(name) https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/spec_helper.rb#L71 lib end +def setup_make + make = ENV['MAKE'] + make ||= (RbConfig::CONFIG['host_os'].include?("mswin") ? "nmake" : "make") + make_flags = ENV["MAKEFLAGS"] || '' + + # suppress logo of nmake.exe to stderr + if File.basename(make, ".*").downcase == "nmake" and !make_flags.include?("l") + ENV["MAKEFLAGS"] = "l#{make_flags}" + end + + opts = {} + if /(?:\A|\s)--jobserver-(?:auth|fds)=(\d+),(\d+)/ =~ make_flags + begin + r = IO.for_fd($1.to_i(10), "rb", autoclose: false) + w = IO.for_fd($2.to_i(10), "wb", autoclose: false) + rescue Errno::EBADF + else + opts[r] = r + opts[w] = w + end + end + + [make, opts] +end + def load_extension(name) require compile_extension(name) rescue LoadError Index: spec/rubyspec/optional/capi/ext/st_spec.c =================================================================== --- spec/rubyspec/optional/capi/ext/st_spec.c (revision 59976) +++ spec/rubyspec/optional/capi/ext/st_spec.c (revision 59977) @@ -13,10 +13,11 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/spec/rubyspec/optional/capi/ext/st_spec.c#L13 #endif #ifdef HAVE_RB_ST -# if SIZEOF_LONG == SIZEOF_VOIDP -# define ST2NUM(x) ULONG2NUM(x) + +#if SIZEOF_LONG == SIZEOF_VOIDP +# define ST2NUM(x) ULONG2NUM(x) #else -# define ST2NUM(x) ULL2NUM(x) +# define ST2NUM(x) ULL2NUM(x) #endif VALUE st_spec_st_init_numtable(VALUE self) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/