Skip to content
Permalink
Browse files
Only try to turn on tracing via RubyVM if it exists.
  • Loading branch information
headius committed Nov 3, 2014
1 parent 47b4623 commit 8dc1ed2fe8924df3779b978e2107c7b90626bb32
Showing 1 changed file with 10 additions and 6 deletions.
@@ -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.