1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix test_version again for RUBY_YJIT_ENABLE=1

This commit is contained in:
Takashi Kokubun 2021-10-20 22:08:42 -07:00
parent 76f9bc7e66
commit 3b16d07e45
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -210,7 +210,9 @@ class TestRubyOptions < Test::Unit::TestCase
env = {'RUBY_YJIT_ENABLE' => nil} # unset in children
assert_in_out_err([env, '--version']) do |r, e|
assert_match(VERSION_PATTERN, r[0])
if defined?(RubyVM::JIT) && RubyVM::JIT.enabled? || defined?(YJIT.enabled?) && YJIT.enabled? # checking -D*JIT_FORCE_ENABLE
if ENV['RUBY_YJIT_ENABLE'] == '1'
assert_equal(NO_JIT_DESCRIPTION, r[0])
elsif defined?(RubyVM::JIT) && RubyVM::JIT.enabled? || defined?(YJIT.enabled?) && YJIT.enabled? # checking -D(M|Y)JIT_FORCE_ENABLE
assert_equal(EnvUtil.invoke_ruby(['-e', 'print RUBY_DESCRIPTION'], '', true).first, r[0])
else
assert_equal(RUBY_DESCRIPTION, r[0])