diff options
author | Eileen M. Uchitelle <[email protected]> | 2022-06-09 17:59:41 -0400 |
---|---|---|
committer | <[email protected]> | 2022-06-09 17:59:41 -0400 |
commit | e69e47f8d62456f85f70d52f736a23eab504f8b4 () | |
tree | 5f7e19f07c69bed95c1fc7ce78c2a7916ae53fca | |
parent | c2468fd88b977b1c0015fe7f49a822df1d07ea6f (diff) |
Fix exit locations test (#5995)
I originally added the check for RubyVM::YJIT.trace_exit_locations_enabled? to fix errors when these tests run without the stats feature enabled. However I forgot that this will never be true when this test is booting, so nothing was running when the stats feature is turned on. Instead I've decided to make a new hash in the dump file and check if exit locations are enabled there. If they aren't enabled we return early to avoid checking for keys that won't exit in the dumped exit locations. I chose to add this additional enabled check because empty exit locations might not indicate that stats isn't enabled, it could mean the feature is entirely broken. I do want these tests to fail if stats are on and nothing was collected. Followup to #5970
Notes: Merged-By: maximecb <[email protected]>
-rw-r--r-- | test/ruby/test_yjit_exit_locations.rb | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -8,7 +8,7 @@ require 'envutil' require 'tmpdir' require_relative '../lib/jit_support' -return unless defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled? && RubyVM::YJIT.trace_exit_locations_enabled? # Tests for YJIT with assertions on tracing exits # insipired by the MJIT tests in test/ruby/test_yjit.rb @@ -40,7 +40,10 @@ class TestYJITExitLocations < Test::Unit::TestCase def assert_exit_locations(test_script) write_results = <<~RUBY - IO.open(3).write Marshal.dump(RubyVM::YJIT.exit_locations) RUBY script = <<~RUBY @@ -51,7 +54,13 @@ class TestYJITExitLocations < Test::Unit::TestCase #{write_results} RUBY - exit_locations = eval_with_jit(script) assert exit_locations.key?(:raw) assert exit_locations.key?(:frames) |