Skip to content

Commit

Permalink
conceptually partial backport from r63103, r65567.
Browse files Browse the repository at this point in the history
All ISeq#to_binary should rescue to skip when running with coverage.
current trunk (2.6-) has assert_iseq_to_binary.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_5@66298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nagachika committed Dec 9, 2018
1 parent 352e8e9 commit 4f13160
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
16 changes: 15 additions & 1 deletion test/ruby/test_iseq.rb
Expand Up @@ -392,6 +392,9 @@ class C # line 7 empty class
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
Expand All @@ -405,9 +408,20 @@ def test_to_binary_with_objects
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
Expand Down
2 changes: 1 addition & 1 deletion version.h
@@ -1,6 +1,6 @@
#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
Expand Down

0 comments on commit 4f13160

Please sign in to comment.