From a065b68bd8d93505304f90bbb1855c864e17ad61 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Sat, 3 Feb 2024 21:37:33 -0800 Subject: Backport #9415 to ruby_3_3 (#9424) YJIT: Let RubyVM::YJIT.enable respect --yjit-stats --- test/ruby/test_yjit.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'test/ruby') diff --git a/test/ruby/test_yjit.rb b/test/ruby/test_yjit.rb index 9d3ec2f6fb..55b86bea78 100644 --- a/test/ruby/test_yjit.rb +++ b/test/ruby/test_yjit.rb @@ -67,7 +67,19 @@ class TestYJIT < Test::Unit::TestCase RUBY end - def test_yjit_enable_stats + def test_yjit_enable_stats_false + assert_separately(["--yjit-disable", "--yjit-stats"], <<~RUBY, ignore_stderr: true) + assert_false RubyVM::YJIT.enabled? + assert_nil RubyVM::YJIT.runtime_stats + + RubyVM::YJIT.enable + + assert_true RubyVM::YJIT.enabled? + assert_true RubyVM::YJIT.runtime_stats[:all_stats] + RUBY + end + + def test_yjit_enable_stats_true args = [] args << "--disable=yjit" if RubyVM::YJIT.enabled? assert_separately(args, <<~RUBY, ignore_stderr: true) -- cgit v1.2.3