diff options
| author | Peter Zhu <peter@peterzhu.ca> | 2025-01-13 15:30:30 -0500 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2025-01-14 16:18:52 +0000 |
| commit | cf4d848cad87f4ee537b79cdf0ae32684b88f165 (patch) | |
| tree | dd2968cf4be9aff47463c232874471aa76e435c0 /test | |
| parent | 12fa76b3e57ea6deb89c7b28fc79eef78df9739e (diff) | |
[ruby/mmtk] Add framework for tests
https://github.com/ruby/mmtk/commit/6d94549fc7
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 |
