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:
nobu 2018-05-29 08:47:07 +00:00
Родитель 2df80d30fe
Коммит 0342fcbd51
2 изменённых файлов: 6 добавлений и 7 удалений

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

@ -7,12 +7,15 @@ while /\A(\w+)=(.*)/ =~ ARGV[0]
end end
if inc = arg['i'] if inc = arg['i']
src = inc == '-' ? STDIN.read : File.read(inc) 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 = {} arg['versions'] = version = {}
File.read(File.join(arg['srcdir'], 'version.c')). File.read(File.join(arg['srcdir'], 'version.c')).
scan(/rb_define_global_const\("(RUBY_\w+)",[^;]*?\bMK(?:INT|STR)\(([^()]*)\)/m) do |n, v| scan(/rb_define_global_const\("(RUBY_\w+)",[^;]*?\bMK(?:INT|STR)\(([^()]*)\)/m) do |n, v|
version[n] = version[n] = src.value(v)
eval(src[/\bruby_#{v}(?:\[\])?\s*=\s*((?:"(?:\\.|[^\"\\])*"\s*)*(?=;)|[^{};]+)/m, 1].gsub(/#/, '\\#'))
end end
version['RUBY_DESCRIPTION'] = src.value('description_with_jit') if RubyVM::MJIT.enabled?
end end
%>baseruby="<%=arg['BASERUBY']%>" %>baseruby="<%=arg['BASERUBY']%>"
_\ _\

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

@ -116,11 +116,7 @@ class TestRubyOptions < Test::Unit::TestCase
def test_verbose def test_verbose
assert_in_out_err(["-vve", ""]) do |r, e| assert_in_out_err(["-vve", ""]) do |r, e|
assert_match(VERSION_PATTERN, r[0]) assert_match(VERSION_PATTERN, r[0])
if RbConfig::CONFIG.fetch('cppflags', '').match?(/(\A|\s)-DMJIT_FORCE_ENABLE\b/)
assert_equal(RUBY_DESCRIPTION, r[0]) assert_equal(RUBY_DESCRIPTION, r[0])
else
assert_equal(NO_JIT_DESCRIPTION, r[0])
end
assert_equal([], e) assert_equal([], e)
end end