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

ruby-changes:26404

From: naruse <ko1@a...>
Date: Wed, 19 Dec 2012 11:25:53 +0900 (JST)
Subject: [ruby-changes:26404] naruse:r38456 (trunk): Push given event only if it is right one

naruse	2012-12-19 11:25:42 +0900 (Wed, 19 Dec 2012)

  New Revision: 38456

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38456

  Log:
    Push given event only if it is right one
    
    On parallel test-all, trace event may fire on another threads

  Modified files:
    trunk/test/ruby/test_settracefunc.rb

Index: test/ruby/test_settracefunc.rb
===================================================================
--- test/ruby/test_settracefunc.rb	(revision 38455)
+++ test/ruby/test_settracefunc.rb	(revision 38456)
@@ -439,7 +439,7 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L439
     begin
     eval <<-EOF.gsub(/^.*?: /, ""), nil, 'xyzzy'
     1: trace = TracePoint.trace(*trace_events){|tp|
-    2:   events << [tp.event, tp.lineno, tp.path, _defined_class.(tp), tp.method_id, tp.self, tp.binding.eval("_local_var"), _get_data.(tp)]
+    2:   events << [tp.event, tp.lineno, tp.path, _defined_class.(tp), tp.method_id, tp.self, tp.binding.eval("_local_var"), _get_data.(tp)] if tp.path == 'xyzzy'
     3: }
     4: 1.times{|;_local_var| _local_var = :inner
     5:   tap{}
@@ -532,7 +532,7 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L532
     _local_var = :outer
     eval <<-EOF.gsub(/^.*?: /, ""), nil, 'xyzzy'
     1: set_trace_func(lambda{|event, file, line, id, binding, klass|
-    2:   events << [event, line, file, klass, id, binding.eval('self'), binding.eval("_local_var")]
+    2:   events << [event, line, file, klass, id, binding.eval('self'), binding.eval("_local_var")] if file == 'xyzzy'
     3: })
     4: 1.times{|;_local_var| _local_var = :inner
     5:   tap{}

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

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