diff options
| author | Yusuke Endoh <mame@ruby-lang.org> | 2024-07-17 16:11:22 +0900 |
|---|---|---|
| committer | Yusuke Endoh <mame@ruby-lang.org> | 2024-07-17 18:41:39 +0900 |
| commit | 3f65df48bdc48e720643209a7a6d58ab60c3609b (patch) | |
| tree | c454b60f746150323b5efb048e1d674702850fba /test/ruby | |
| parent | af6031786171a65b24b388416c05551f0f104a29 (diff) | |
Report a TracePoint log when the TracePoint tests fail
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11184
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_settracefunc.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/test/ruby/test_settracefunc.rb b/test/ruby/test_settracefunc.rb index c7998ef1f1..0a3faa0e4f 100644 --- a/test/ruby/test_settracefunc.rb +++ b/test/ruby/test_settracefunc.rb @@ -1373,9 +1373,11 @@ CODE def test_a_call events = [] + log = [] TracePoint.new(:a_call){|tp| next if !target_thread? events << tp.event + log << "| event:#{ tp.event } method_id:#{ tp.method_id } #{ tp.path }:#{ tp.lineno }" }.enable{ [1].map{ 3 @@ -1391,14 +1393,16 @@ CODE :c_call, :call, :b_call, - ], events) + ], events, "TracePoint log:\n#{ log.join("\n") }\n") end def test_a_return events = [] + log = [] TracePoint.new(:a_return){|tp| next if !target_thread? events << tp.event + log << "| event:#{ tp.event } method_id:#{ tp.method_id } #{ tp.path }:#{ tp.lineno }" }.enable{ [1].map{ 3 @@ -1414,7 +1418,7 @@ CODE :b_return, :return, :b_return - ], events) + ], events, "TracePoint log:\n#{ log.join("\n") }\n") end def test_const_missing |
