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
|
class TestSetTraceFunc < Test::Unit::TestCase
|
||||||
def setup
|
def setup
|
||||||
@original_compile_option = RubyVM::InstructionSequence.compile_option
|
if defined?(RubyVM)
|
||||||
RubyVM::InstructionSequence.compile_option = {
|
@original_compile_option = RubyVM::InstructionSequence.compile_option
|
||||||
:trace_instruction => true,
|
RubyVM::InstructionSequence.compile_option = {
|
||||||
:specialized_instruction => false
|
:trace_instruction => true,
|
||||||
}
|
:specialized_instruction => false
|
||||||
|
}
|
||||||
|
end
|
||||||
@target_thread = Thread.current
|
@target_thread = Thread.current
|
||||||
end
|
end
|
||||||
|
|
||||||
def teardown
|
def teardown
|
||||||
set_trace_func(nil)
|
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
|
@target_thread = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue