-
-
Save jahfer/092e44df6f15298bae3cf47056301708 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class FixtureInner | |
def do_work | |
raise unless sum == 2 | |
end | |
def sum | |
1 + 1 | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class FixtureOuter | |
def initialize | |
@inner = FixtureInner.new | |
end | |
def do_work | |
@inner.do_work | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
event | entity | method_name | method_level | line_event_filepath | line_event_lineno | tracepoint_filepath | tracepoint_lineno | caller_locations backtrace | |
---|---|---|---|---|---|---|---|---|---|
c_call | FixtureOuter | new | singleton | rotoscope_test.rb | 91 | rotoscope_test.rb | 91 | /Users/jahfer/src/github.com/Shopify/rotoscope/lib/rotoscope.rb:7:in `block in trace' | |
call | FixtureOuter | initialize | instance | rotoscope_test.rb | 91 | fixture_outer.rb | 3 | rotoscope_test.rb:91:in `block in test_ignores_calls_if_blacklisted' | |
c_call | FixtureInner | new | singleton | fixture_outer.rb | 4 | fixture_outer.rb | 4 | rotoscope_test.rb:91:in `new' | |
c_call | FixtureInner | initialize | instance | fixture_outer.rb | 4 | fixture_outer.rb | 4 | fixture_outer.rb:4:in `initialize' | |
c_return | FixtureInner | initialize | instance | fixture_outer.rb | 4 | fixture_outer.rb | 4 | fixture_outer.rb:4:in `initialize' | |
c_return | FixtureInner | new | singleton | fixture_outer.rb | 4 | fixture_outer.rb | 4 | rotoscope_test.rb:91:in `new' | |
return | FixtureOuter | initialize | instance | fixture_outer.rb | 4 | fixture_outer.rb | 5 | rotoscope_test.rb:91:in `block in test_ignores_calls_if_blacklisted' | |
c_return | FixtureOuter | new | singleton | rotoscope_test.rb | 91 | rotoscope_test.rb | 91 | /Users/jahfer/src/github.com/Shopify/rotoscope/lib/rotoscope.rb:7:in `block in trace' | |
call | FixtureOuter | do_work | instance | rotoscope_test.rb | 92 | fixture_outer.rb | 7 | /Users/jahfer/src/github.com/Shopify/rotoscope/lib/rotoscope.rb:7:in `block in trace' | |
call | FixtureInner | do_work | instance | fixture_outer.rb | 8 | fixture_inner.rb | 3 | rotoscope_test.rb:92:in `block in test_ignores_calls_if_blacklisted' | |
call | FixtureInner | sum | instance | fixture_inner.rb | 4 | fixture_inner.rb | 7 | fixture_outer.rb:8:in `do_work' | |
return | FixtureInner | sum | instance | fixture_inner.rb | 8 | fixture_inner.rb | 9 | fixture_outer.rb:8:in `do_work' | |
return | FixtureInner | do_work | instance | fixture_inner.rb | 8 | fixture_inner.rb | 5 | rotoscope_test.rb:92:in `block in test_ignores_calls_if_blacklisted' | |
return | FixtureOuter | do_work | instance | fixture_inner.rb | 8 | fixture_outer.rb | 9 | /Users/jahfer/src/github.com/Shopify/rotoscope/lib/rotoscope.rb:7:in `block in trace' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_ignores_calls_if_blacklisted | |
contents = rotoscope_trace do | |
foo = FixtureOuter.new # line 91 | |
foo.do_work # line 92 | |
end | |
end | |
def rotoscope_trace(blacklist = [], &block) | |
Rotoscope.trace(@logfile, blacklist, &block) | |
unzip(@logfile) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
:line
tracepoint location around so it can be used on invocations of:call
and:return
tracepointsrb_tracearg_path
caller_locations(0, 1)
forc_call
andcaller_locations(1,1)
forcall
. In the end, identical results are returned usingcaller_locations(1,1)
for bothc_call
andcall
.