diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/mmtk/helper.rb | 21 | ||||
| -rw-r--r-- | test/mmtk/test_configuration.rb | 16 |
2 files changed, 37 insertions, 0 deletions
diff --git a/test/mmtk/helper.rb b/test/mmtk/helper.rb new file mode 100644 index 0000000000..e4cff30389 --- /dev/null +++ b/test/mmtk/helper.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require "test/unit" +require "core_assertions" + +module MMTk + class TestCase < ::Test::Unit::TestCase + include Test::Unit::CoreAssertions + + def setup + omit "Not running on MMTk" unless using_mmtk? + super + end + + private + + def using_mmtk? + GC.config[:implementation] == "mmtk" + end + end +end diff --git a/test/mmtk/test_configuration.rb b/test/mmtk/test_configuration.rb new file mode 100644 index 0000000000..1191a27e6d --- /dev/null +++ b/test/mmtk/test_configuration.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true +require_relative "helper" +module MMTk + class TestConfiguration < TestCase + def test_invalid_MMTK_THREADS + exit_code = assert_in_out_err( + [{ "MMTK_THREADS" => "foobar" }, "--"], + "", + [], + ["[FATAL] Invalid MMTK_THREADS foobar"] + ) + + assert_equal(1, exit_code.exitstatus) + end + end +end |
