mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
revert r62291 for now
While some of CIs are succeeding and the test succeeds on my laptop, some other CIs are failing. As I don't have time to fix it until I come back to home, reverting this for now. Failures: https://rubyci.org/logs/www.rubyist.net/~akr/chkbuild/debian/ruby-trunk/log/20180208T000401Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-9d6766/ruby-trunk/log/20180207T201706Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu1604/ruby-trunk/log/20180207T183004Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/gentoo/ruby-trunk/log/20180207T213004Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos6/ruby-trunk/log/20180207T213003Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/fedora25/ruby-trunk/log/20180207T213003Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/fedora26/ruby-trunk/log/20180207T213003Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/opensuseleap/ruby-trunk/log/20180207T213001Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-trunk/log/20180207T223303Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/osx1011/ruby-trunk/log/20180207T234501Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/osx1012/ruby-trunk/log/20180207T234501Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/icc-x64/ruby-trunk/log/20180207T210002Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20180207T231805Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20180207T232403Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-trunk/log/20180207T171914Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20180207T232503Z.fail.html.gz https://rubyci.org/logs/mswinci.japaneast.cloudapp.azure.com/vc12-x64/ruby-trunk/log/20180207T172813Z.fail.html.gz http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506100 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506114 http://ci.rvm.jp/results/trunk_clang_40@silicon-docker/506119 http://ci.rvm.jp/results/trunk_clang_39@silicon-docker/506170 http://ci.rvm.jp/results/trunk-nopara@silicon-docker/506176 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506192 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506202 http://ci.rvm.jp/results/trunk_clang_39@silicon-docker/506244 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506271 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506280 http://ci.rvm.jp/results/trunk-nopara@silicon-docker/506323 http://ci.rvm.jp/results/trunk_clang_50@silicon-docker/506325 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506342 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506354 http://ci.rvm.jp/results/trunk_clang_39@silicon-docker/506385 http://ci.rvm.jp/results/trunk_clang_40@silicon-docker/506389 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506409 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506425 http://ci.rvm.jp/results/trunk_clang_40@silicon-docker/506471 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506484 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506495 http://ci.rvm.jp/results/trunk-test@x2/506524 http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/506547 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506556 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506579 http://ci.rvm.jp/results/trunk-nopara@silicon-docker/506582 http://ci.rvm.jp/results/trunk_clang_50@silicon-docker/506634 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506638 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506663 http://ci.rvm.jp/results/trunk-test@frontier/506690 http://ci.rvm.jp/results/trunk_clang_40@silicon-docker/506718 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506728 http://ci.rvm.jp/results/trunk-nopara@silicon-docker/506752 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506754 http://ci.rvm.jp/results/trunk-gc-asserts@silicon-docker/506782 http://ci.rvm.jp/results/trunk_clang_38@silicon-docker/506799 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506816 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506835 http://ci.rvm.jp/results/trunk-nopara@silicon-docker/506879 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506903 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/506920 http://ci.rvm.jp/results/trunk-test@frontier/506955 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/506994 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/507012 http://ci.rvm.jp/results/trunk-vm-asserts@silicon-docker/507036 http://ci.rvm.jp/results/trunk_clang_40@silicon-docker/507037 http://ci.rvm.jp/results/trunk-nopara@silicon-docker/507053 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/507081 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/507097 http://ci.rvm.jp/results/trunk_clang_40@silicon-docker/507136 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/507165 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/507178 http://ci.rvm.jp/results/trunk-nopara@silicon-docker/507180 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/507257 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/507268 http://ci.rvm.jp/results/trunk-gc-asserts@silicon-docker/507303 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/507342 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/507355 http://ci.rvm.jp/results/trunk_gcc5@silicon-docker/507434 http://ci.rvm.jp/results/trunk_gcc4@silicon-docker/507448 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2d6807ac03
commit
571bb73410
1 changed files with 0 additions and 60 deletions
|
@ -1,60 +0,0 @@
|
|||
# frozen_string_literal: true
|
||||
require 'test/unit'
|
||||
|
||||
# Test for --jit option
|
||||
class TestJIT < Test::Unit::TestCase
|
||||
JIT_TIMEOUT = 600 # 10min for each...
|
||||
JIT_SUCCESS_PREFIX = 'JIT success \(\d+\.\dms\)'
|
||||
|
||||
def test_jit
|
||||
assert_eval_with_jit('print proc { 1 + 1 }.call', stdout: '2', success_count: 1)
|
||||
end
|
||||
|
||||
def test_jit_output
|
||||
skip unless jit_available?
|
||||
|
||||
out, err = eval_with_jit('5.times { puts "MJIT" }', verbose: 1, min_calls: 5)
|
||||
assert_equal("MJIT\n" * 5, out)
|
||||
assert_match(/^#{JIT_SUCCESS_PREFIX}: block in <main>@-e:1 -> .+_ruby_mjit_p\d+u\d+\.c$/, err)
|
||||
assert_match(/^Successful MJIT finish$/, err)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
# 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)
|
||||
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
|
||||
end
|
||||
|
||||
# Run Ruby script with --jit-wait (Synchronous JIT compilation).
|
||||
# Returns [stdout, stderr]
|
||||
def eval_with_jit(script, verbose: 0, min_calls: 5)
|
||||
stdout, stderr, status = EnvUtil.invoke_ruby(
|
||||
['--disable-gems', '--jit-wait', "--jit-verbose=#{verbose}", "--jit-min-calls=#{min_calls}", '-e', script],
|
||||
'', true, true, timeout: JIT_TIMEOUT,
|
||||
)
|
||||
assert_equal(true, status.success?, "Failed to run script with JIT:\n#{code_block(script)}")
|
||||
[stdout, stderr]
|
||||
end
|
||||
|
||||
def code_block(code)
|
||||
"```\n#{code}\n```\n\n"
|
||||
end
|
||||
|
||||
# If this is false, tests which require JIT should be skipped.
|
||||
# When this is not checked, probably the test expects Ruby to behave in the same way even if JIT is not supported.
|
||||
def jit_available?
|
||||
@jit_available ||= (EnvUtil.invoke_ruby(['--jit', '-e', 'print RubyVM::MJIT.enabled?'], '', true, true).first == 'true')
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue