[前][次][番号順一覧][スレッド一覧]

ruby-changes:47896

From: yui-knk <ko1@a...>
Date: Mon, 25 Sep 2017 09:09:50 +0900 (JST)
Subject: [ruby-changes:47896] yui-knk:r60015 (trunk): test/ruby/test_iseq.rb: Skip test_safe_call_chain if Coverage is running.

yui-knk	2017-09-25 09:09:44 +0900 (Mon, 25 Sep 2017)

  New Revision: 60015

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60015

  Log:
    test/ruby/test_iseq.rb: Skip test_safe_call_chain if Coverage is running.
    
    Follow up to r59990.
    When Coverage is running, trace2 instructions are inserted
    to take branch coverages for safe method invocations.
    This insertion makes safe call chains unable to be optimized
    and breaks this test case.
    So we test it only when Coverage is not running.

  Modified files:
    trunk/test/ruby/test_iseq.rb
Index: test/ruby/test_iseq.rb
===================================================================
--- test/ruby/test_iseq.rb	(revision 60014)
+++ test/ruby/test_iseq.rb	(revision 60015)
@@ -186,12 +186,14 @@ class TestISeq < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_iseq.rb#L186
     assert_predicate(s4, :frozen?)
   end
 
+  # Safe call chain is not optimized when Coverage is running.
+  # So we can test it only when Coverage is not running.
   def test_safe_call_chain
     src = "a&.a&.a&.a&.a&.a"
     body = compile(src, __LINE__, {peephole_optimization: true}).to_a[13]
     labels = body.select {|op, arg| op == :branchnil}.map {|op, arg| arg}
     assert_equal(1, labels.uniq.size)
-  end
+  end if (!defined?(Coverage) || !Coverage.running?)
 
   def test_parent_iseq_mark
     assert_separately([], <<-'end;', timeout: 20)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]