test_rubyoptions.rb: let all tests work with --jit

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63288 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-04-28 09:11:25 +00:00
Родитель acacd7a1d3
Коммит 6090206275
1 изменённых файлов: 9 добавлений и 4 удалений

Просмотреть файл

@ -6,6 +6,13 @@ require 'tempfile'
require_relative '../lib/jit_support'
class TestRubyOptions < Test::Unit::TestCase
NO_JIT_DESCRIPTION =
if RubyVM::MJIT.enabled?
RUBY_DESCRIPTION.sub(/\+JIT /, '')
else
RUBY_DESCRIPTION
end
def write_file(filename, content)
File.open(filename, "w") {|f|
f << content
@ -109,9 +116,7 @@ class TestRubyOptions < Test::Unit::TestCase
def test_verbose
assert_in_out_err(["-vve", ""]) do |r, e|
assert_match(VERSION_PATTERN, r[0])
description = RUBY_DESCRIPTION
description = description.sub(/\+JIT /, '') if RubyVM::MJIT.enabled?
assert_equal(description, r[0])
assert_equal(NO_JIT_DESCRIPTION, r[0])
assert_equal([], e)
end
@ -637,7 +642,7 @@ class TestRubyOptions < Test::Unit::TestCase
-e:(?:1:)?\s\[BUG\]\sSegmentation\sfault.*\n
)x,
%r(
#{ Regexp.quote(RUBY_DESCRIPTION) }\n\n
#{ Regexp.quote(NO_JIT_DESCRIPTION) }\n\n
)x,
%r(
(?:--\s(?:.+\n)*\n)?