From 686424ea3e8881e768cc777a82301e3de652ecc7 Mon Sep 17 00:00:00 2001 From: k0kubun Date: Wed, 7 Feb 2018 16:28:17 +0000 Subject: 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 --- test/ruby/test_jit.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'test') diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index 85ce611067..52d5d399fa 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -24,12 +24,14 @@ class TestJIT < Test::Unit::TestCase # Shorthand for normal test cases def assert_eval_with_jit(script, stdout: nil, success_count:) out, err = eval_with_jit(script, verbose: 1, min_calls: 1) - actual = err.scan(/^#{JIT_SUCCESS_PREFIX}:/).size - assert_equal( - success_count, actual, - "Expected #{success_count} times of JIT success, but succeeded #{actual} times.\n\n"\ - "script:\n#{code_block(script)}\nstderr:\n#{code_block(err)}", - ) + if jit_available? + actual = err.scan(/^#{JIT_SUCCESS_PREFIX}:/).size + assert_equal( + success_count, actual, + "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 assert_match(stdout, out, "Expected stderr #{out.inspect} to match #{stdout.inspect} with script:\n#{code_block(script)}") end -- cgit v1.2.3