summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2024-02-03 21:37:33 -0800
committerGitHub <noreply@github.com>2024-02-04 05:37:33 +0000
commita065b68bd8d93505304f90bbb1855c864e17ad61 (patch)
tree338f5c7e230d55ef598a43ccb887496b164b2227 /test/ruby
parentba16b340981942eda82d6328800b8098c452c0ca (diff)
Backport #9415 to ruby_3_3 (#9424)
YJIT: Let RubyVM::YJIT.enable respect --yjit-stats
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_yjit.rb14
1 files changed, 13 insertions, 1 deletions
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)