ruby-changes:54078
From: nagachika <ko1@a...>
Date: Sun, 9 Dec 2018 15:46:49 +0900 (JST)
Subject: [ruby-changes:54078] nagachika:r66298 (ruby_2_5): conceptually partial backport from r63103, r65567.
nagachika 2018-12-09 15:46:44 +0900 (Sun, 09 Dec 2018) New Revision: 66298 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66298 Log: conceptually partial backport from r63103, r65567. All ISeq#to_binary should rescue to skip when running with coverage. current trunk (2.6-) has assert_iseq_to_binary. Modified files: branches/ruby_2_5/test/ruby/test_iseq.rb branches/ruby_2_5/version.h Index: ruby_2_5/test/ruby/test_iseq.rb =================================================================== --- ruby_2_5/test/ruby/test_iseq.rb (revision 66297) +++ ruby_2_5/test/ruby/test_iseq.rb (revision 66298) @@ -392,6 +392,9 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_iseq.rb#L392 end def test_to_binary_with_objects + # conceptually backport from r62856. + # ISeq binary dump doesn't consider alignment in 2.5 and older + skip "does not work on other than x86" unless /x(?:86|64)|i\d86/ =~ RUBY_PLATFORM code = "[]"+100.times.map{|i|"<</#{i}/"}.join iseq = RubyVM::InstructionSequence.compile(code) bin = assert_nothing_raised do @@ -405,9 +408,20 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_5/test/ruby/test_iseq.rb#L408 end def test_to_binary_tracepoint + # conceptually backport from r62856. + # ISeq binary dump doesn't consider alignment in 2.5 and older + skip "does not work on other than x86" unless /x(?:86|64)|i\d86/ =~ RUBY_PLATFORM filename = "#{File.basename(__FILE__)}_#{__LINE__}" iseq = RubyVM::InstructionSequence.compile("x = 1\n y = 2", filename) - iseq_bin = iseq.to_binary + # conceptually partial backport from r63103, r65567. + # All ISeq#to_binary should rescue to skip when running with coverage. + # current trunk (2.6-) has assert_iseq_to_binary. + begin + iseq_bin = iseq.to_binary + rescue RuntimeError => e + skip e.message if /compile with coverage/ =~ e.message + raise + end ary = [] TracePoint.new(:line){|tp| next unless tp.path == filename Index: ruby_2_5/version.h =================================================================== --- ruby_2_5/version.h (revision 66297) +++ ruby_2_5/version.h (revision 66298) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_5/version.h#L1 #define RUBY_VERSION "2.5.4" #define RUBY_RELEASE_DATE "2018-12-09" -#define RUBY_PATCHLEVEL 121 +#define RUBY_PATCHLEVEL 122 #define RUBY_RELEASE_YEAR 2018 #define RUBY_RELEASE_MONTH 12 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/