diff options
author | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-26 15:15:46 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-27 13:00:05 -0400 |
commit | fdbae38546c6cd352e5becfd6c555ea22eb64b96 (patch) | |
tree | 230bc7a25b7c363ee91c3398e20f5bf0b24b4ab2 /test | |
parent | 6875d6d1fa086fcec58c9d888cbacc1e108a0935 (diff) |
YJIT: move --yjit-stats at_exit call into Ruby
This change fixes `-v --yjit-stats`. Previously in this situation,
YJIT._print_stats wasn't defined as yjit.rb is not evaluated when there
is only "-v" and no Ruby code to run.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/5022
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_yjit.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 218d68ea4b..9014a1e567 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -37,6 +37,11 @@ class TestYJIT < Test::Unit::TestCase assert_in_out_err('--yjit-greedy-versioning=1', '', [], /warning: argument to --yjit-greedy-versioning is ignored/) end + def test_yjit_stats_and_v_no_error + _stdout, stderr, _status = EnvUtil.invoke_ruby(%w(-v --yjit-stats), '', true, true) + refute_includes(stderr, "NoMethodError") + end + def test_enable_from_env_var yjit_child_env = {'RUBY_YJIT_ENABLE' => '1'} assert_in_out_err([yjit_child_env, '--version'], '') do |stdout, stderr| |