mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Don't tweak RubyVM compile options if it's not defined
This commit is contained in:
parent
43ed4eb6d1
commit
03f9e8746e
1 changed files with 10 additions and 6 deletions
|
@ -3,17 +3,21 @@ require 'test/unit'
|
|||
|
||||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue