mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fake.rb: fix RUBY_DESCRIPTION for MJIT
* template/fake.rb.in: reflect MJIT to RUBY_DESCRIPTION. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2df80d30fe
commit
0342fcbd51
2 changed files with 6 additions and 7 deletions
|
@ -7,12 +7,15 @@ while /\A(\w+)=(.*)/ =~ ARGV[0]
|
|||
end
|
||||
if inc = arg['i']
|
||||
src = inc == '-' ? STDIN.read : File.read(inc)
|
||||
def src.value(name)
|
||||
eval(self[/\bruby_#{name}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].gsub(/#/, '\\#'))
|
||||
end
|
||||
arg['versions'] = version = {}
|
||||
File.read(File.join(arg['srcdir'], 'version.c')).
|
||||
scan(/rb_define_global_const\("(RUBY_\w+)",[^;]*?\bMK(?:INT|STR)\(([^()]*)\)/m) do |n, v|
|
||||
version[n] =
|
||||
eval(src[/\bruby_#{v}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].gsub(/#/, '\\#'))
|
||||
version[n] = src.value(v)
|
||||
end
|
||||
version['RUBY_DESCRIPTION'] = src.value('description_with_jit') if RubyVM::MJIT.enabled?
|
||||
end
|
||||
%>baseruby="<%=arg['BASERUBY']%>"
|
||||
_\
|
||||
|
|
|
@ -116,11 +116,7 @@ class TestRubyOptions < Test::Unit::TestCase
|
|||
def test_verbose
|
||||
assert_in_out_err(["-vve", ""]) do |r, e|
|
||||
assert_match(VERSION_PATTERN, r[0])
|
||||
if RbConfig::CONFIG.fetch('cppflags', '').match?(/(\A|\s)-DMJIT_FORCE_ENABLE\b/)
|
||||
assert_equal(RUBY_DESCRIPTION, r[0])
|
||||
else
|
||||
assert_equal(NO_JIT_DESCRIPTION, r[0])
|
||||
end
|
||||
assert_equal(RUBY_DESCRIPTION, r[0])
|
||||
assert_equal([], e)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue