summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2024-01-05 11:08:57 -0800
committerGitHub <noreply@github.com>2024-01-05 14:08:57 -0500
commit7f9c174102d0e2369befc7b88f2c073becaa7560 (patch)
treea93656a64f59286af7d8f95b38b2dc314227e7b6 /test/ruby
parent4d03140009044096ac1903281682f357ab4acf98 (diff)
YJIT: Let RubyVM::YJIT.enable respect --yjit-stats (#9415)
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)