Skip to content

Commit 37c6fe5

Browse files
authored
Refine MMTk tests for different plans (#25)
1 parent e4d3c4b commit 37c6fe5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/ruby/test_mmtk.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ def test_description
3737
def test_enable
3838
ENABLE_OPTIONS.each do |version_args|
3939
assert_in_out_err(['--version'] + version_args) do |stdout, stderr|
40-
assert_equal(RUBY_DESCRIPTION, stdout.first)
40+
# Need to scrub the description because --mmtk etc will use the default plan
41+
assert_equal(scrub_desc(RUBY_DESCRIPTION), scrub_desc(stdout.first))
4142
assert_equal([], stderr)
4243
end
4344
end
@@ -47,7 +48,8 @@ def test_enable_from_rubyopt
4748
ENABLE_OPTIONS.each do |version_args|
4849
mmtk_child_env = {'RUBYOPT' => version_args.join(' ')}
4950
assert_in_out_err([mmtk_child_env, '--version'], '') do |stdout, stderr|
50-
assert_equal(RUBY_DESCRIPTION, stdout.first)
51+
# Need to scrub the description because --mmtk etc will use the default plan
52+
assert_equal(scrub_desc(RUBY_DESCRIPTION), scrub_desc(stdout.first))
5153
assert_equal([], stderr)
5254
end
5355
end
@@ -107,4 +109,8 @@ def test_gc_stat
107109
assert_operator(GC.stat(:mmtk_free_bytes), :<=, GC.stat(:mmtk_total_bytes))
108110
assert_operator(GC.stat(:mmtk_used_bytes), :<=, GC.stat(:mmtk_total_bytes))
109111
end
112+
113+
def scrub_desc(desc)
114+
desc.gsub(/\((MarkSweep|NoGC)\)/, '(XGC)')
115+
end
110116
end

0 commit comments

Comments
 (0)