Skip to content

Commit f6ef4ef

Browse files
committed
ZJIT: Add a test for --zjit-stats=<path> option
Fix up ruby#15414, 29c29c2
1 parent 3a4d534 commit f6ef4ef

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/ruby/test_zjit.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ def test = 42
4949
assert_success(out, err, status)
5050
refute_includes(err, stats_header)
5151
assert_equal("true\n", out)
52+
53+
# With --zjit-stats=<path>, stats should be printed to the path
54+
Tempfile.create("zjit-stats-") {|tmp|
55+
stats_file = tmp.path
56+
tmp.puts("Lorem ipsum dolor sit amet, consectetur adipiscing elit, ...")
57+
tmp.close
58+
59+
out, err, status = eval_with_jit(script, stats: stats_file)
60+
assert_success(out, err, status)
61+
refute_includes(err, stats_header)
62+
assert_equal("true\n", out)
63+
assert_equal stats_header, File.open(stats_file) {|f| f.gets(chomp: true)}, "should be overwritten"
64+
}
5265
end
5366

5467
def test_enable_through_env

0 commit comments

Comments
 (0)