mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
acacd7a1d3
commit
6090206275
1 changed files with 9 additions and 4 deletions
|
@ -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)?
|
||||
|
|
Loading…
Reference in a new issue