Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions test/ruby/test_mmtk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def test_description
def test_enable
ENABLE_OPTIONS.each do |version_args|
assert_in_out_err(['--version'] + version_args) do |stdout, stderr|
assert_equal(RUBY_DESCRIPTION, stdout.first)
# Need to scrub the description because --mmtk etc will use the default plan
assert_equal(scrub_desc(RUBY_DESCRIPTION), scrub_desc(stdout.first))
assert_equal([], stderr)
end
end
Expand All @@ -47,7 +48,8 @@ def test_enable_from_rubyopt
ENABLE_OPTIONS.each do |version_args|
mmtk_child_env = {'RUBYOPT' => version_args.join(' ')}
assert_in_out_err([mmtk_child_env, '--version'], '') do |stdout, stderr|
assert_equal(RUBY_DESCRIPTION, stdout.first)
# Need to scrub the description because --mmtk etc will use the default plan
assert_equal(scrub_desc(RUBY_DESCRIPTION), scrub_desc(stdout.first))
assert_equal([], stderr)
end
end
Expand Down Expand Up @@ -107,4 +109,8 @@ def test_gc_stat
assert_operator(GC.stat(:mmtk_free_bytes), :<=, GC.stat(:mmtk_total_bytes))
assert_operator(GC.stat(:mmtk_used_bytes), :<=, GC.stat(:mmtk_total_bytes))
end

def scrub_desc(desc)
desc.gsub(/\((MarkSweep|NoGC)\)/, '(XGC)')
end
end