mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix uplevel
This commit is contained in:
parent
e03b3b4ae0
commit
ee1334189b
1 changed files with 4 additions and 4 deletions
|
@ -951,17 +951,17 @@ class TestJIT < Test::Unit::TestCase
|
||||||
private
|
private
|
||||||
|
|
||||||
# The shortest way to test one proc
|
# The shortest way to test one proc
|
||||||
def assert_compile_once(script, result_inspect:, insns: [])
|
def assert_compile_once(script, result_inspect:, insns: [], uplevel: 1)
|
||||||
if script.match?(/\A\n.+\n\z/m)
|
if script.match?(/\A\n.+\n\z/m)
|
||||||
script = script.gsub(/^/, ' ')
|
script = script.gsub(/^/, ' ')
|
||||||
else
|
else
|
||||||
script = " #{script} "
|
script = " #{script} "
|
||||||
end
|
end
|
||||||
assert_eval_with_jit("p proc {#{script}}.call", stdout: "#{result_inspect}\n", success_count: 1, insns: insns, uplevel: 2)
|
assert_eval_with_jit("p proc {#{script}}.call", stdout: "#{result_inspect}\n", success_count: 1, insns: insns, uplevel: uplevel + 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Shorthand for normal test cases
|
# Shorthand for normal test cases
|
||||||
def assert_eval_with_jit(script, stdout: nil, success_count:, min_calls: 1, insns: [], uplevel: 3)
|
def assert_eval_with_jit(script, stdout: nil, success_count:, min_calls: 1, insns: [], uplevel: 1)
|
||||||
out, err = eval_with_jit(script, verbose: 1, min_calls: min_calls)
|
out, err = eval_with_jit(script, verbose: 1, min_calls: min_calls)
|
||||||
actual = err.scan(/^#{JIT_SUCCESS_PREFIX}:/).size
|
actual = err.scan(/^#{JIT_SUCCESS_PREFIX}:/).size
|
||||||
# Add --jit-verbose=2 logs for cl.exe because compiler's error message is suppressed
|
# Add --jit-verbose=2 logs for cl.exe because compiler's error message is suppressed
|
||||||
|
@ -975,7 +975,7 @@ class TestJIT < Test::Unit::TestCase
|
||||||
insns.each do |insn|
|
insns.each do |insn|
|
||||||
unless used_insns.include?(insn)
|
unless used_insns.include?(insn)
|
||||||
$stderr.puts
|
$stderr.puts
|
||||||
warn "'#{insn}' insn is not included in the script. Actual insns are: #{used_insns.join(' ')}\n", uplevel: uplevel
|
warn "'#{insn}' insn is not included in the script. Actual insns are: #{used_insns.join(' ')}\n", uplevel: uplevel+2
|
||||||
end
|
end
|
||||||
TestJIT.untested_insns.delete(insn)
|
TestJIT.untested_insns.delete(insn)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue