From fdbae38546c6cd352e5becfd6c555ea22eb64b96 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Tue, 26 Oct 2021 15:15:46 -0400 Subject: 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. --- test/ruby/test_yjit.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/ruby') 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| -- cgit v1.2.3