1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

test_jit.rb: make JIT count test optional

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62294 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-02-07 16:28:17 +00:00
parent 89352607a9
commit 686424ea3e

View file

@ -24,12 +24,14 @@ class TestJIT < Test::Unit::TestCase
# Shorthand for normal test cases # Shorthand for normal test cases
def assert_eval_with_jit(script, stdout: nil, success_count:) def assert_eval_with_jit(script, stdout: nil, success_count:)
out, err = eval_with_jit(script, verbose: 1, min_calls: 1) out, err = eval_with_jit(script, verbose: 1, min_calls: 1)
actual = err.scan(/^#{JIT_SUCCESS_PREFIX}:/).size if jit_available?
assert_equal( actual = err.scan(/^#{JIT_SUCCESS_PREFIX}:/).size
success_count, actual, assert_equal(
"Expected #{success_count} times of JIT success, but succeeded #{actual} times.\n\n"\ success_count, actual,
"script:\n#{code_block(script)}\nstderr:\n#{code_block(err)}", "Expected #{success_count} times of JIT success, but succeeded #{actual} times.\n\n"\
) "script:\n#{code_block(script)}\nstderr:\n#{code_block(err)}",
)
end
if stdout if stdout
assert_match(stdout, out, "Expected stderr #{out.inspect} to match #{stdout.inspect} with script:\n#{code_block(script)}") assert_match(stdout, out, "Expected stderr #{out.inspect} to match #{stdout.inspect} with script:\n#{code_block(script)}")
end end