Skip to content

Commit

Permalink
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions test/mri/ruby/test_settracefunc.rb
Original file line number Diff line number Diff line change
@@ -3,17 +3,21 @@

class TestSetTraceFunc < Test::Unit::TestCase
def setup
@original_compile_option = RubyVM::InstructionSequence.compile_option
RubyVM::InstructionSequence.compile_option = {
:trace_instruction => true,
:specialized_instruction => false
}
if defined?(RubyVM)
@original_compile_option = RubyVM::InstructionSequence.compile_option
RubyVM::InstructionSequence.compile_option = {
:trace_instruction => true,
:specialized_instruction => false
}
end
@target_thread = Thread.current
end

def teardown
set_trace_func(nil)
RubyVM::InstructionSequence.compile_option = @original_compile_option
if defined?(RubyVM)
RubyVM::InstructionSequence.compile_option = @original_compile_option
end
@target_thread = nil
end

0 comments on commit 8dc1ed2

Please sign in to comment.