Skip to content

Commit d5079bc

Browse files
committed
jt test commands for basictest and bootstraptest
1 parent 932e5e2 commit d5079bc

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ local part_definitions = {
406406
] + jt(["lint"]) + self.after_build,
407407
},
408408

409-
test_basictest: { run+: jt(["ruby", "test/basictest/runner.rb"]) },
409+
test_basictest: { run+: jt(["test", "basictest"]) },
410410
test_mri: { run+: jt(["test", "mri", "--no-sulong", "--", "-j4"]) },
411411
test_integration: { run+: jt(["test", "integration"]) },
412412
test_gems: { run+: jt(["test", "gems"]) },

doc/contributor/testing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ Run MRI tests with `jt test mri`.
7171
MRI's basictest is a smaller set of tests for some basic control structures
7272
and language features. It is in `test/basictest`.
7373

74-
Run basictest with `jt ruby test/basictest/runner.rb`.
74+
Run basictest with `jt test basictest`.
7575

7676
### MRI bootstraptest
7777

7878
MRI's bootstraptest is a smaller set of tests for functionality they require
7979
to bootstrap their implementation, including some tests against regressions
8080
and corner cases. It is in `test/bootstraptest`.
8181

82-
Run bootstraptest with `jt ruby test/bootstraptest/runner.rb`. It's not
82+
Run bootstraptest with `jt test bootstraptest`. It's not
8383
tractable to run bootstraptest with the JVM, as it starts a new Ruby process
8484
for each test. Run it with a native build instead.
8585

tool/jt.rb

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ def help
547547
jt puts 14 + 2 evaluate and print an expression
548548
jt cextc directory clang-args compile the C extension in directory, with optional extra clang arguments
549549
jt test run all mri tests, specs and integration tests
550+
jt test basictest run MRI's basictest suite
551+
jt test bootstraptest run MRI's bootstraptest suite
550552
jt test mri run mri tests
551553
#{MRI_TEST_MODULES.map { |k, h| format ' '*10+'%-16s%s', k, h[:help] }.join("\n")}
552554
--native use native TruffleRuby image (set AOT_BIN)
@@ -879,6 +881,8 @@ def test(*args)
879881
when 'gems' then test_gems(*rest)
880882
when 'ecosystem' then test_ecosystem(*rest)
881883
when 'specs' then test_specs('run', *rest)
884+
when 'basictest' then test_basictest(*rest)
885+
when 'bootstraptest' then test_bootstraptest(*rest)
882886
when 'mri' then test_mri(*rest)
883887
else
884888
if File.expand_path(path, TRUFFLERUBY_DIR).start_with?("#{TRUFFLERUBY_DIR}/test")
@@ -894,6 +898,27 @@ def jt(*args)
894898
end
895899
private :jt
896900

901+
def test_basictest(*args)
902+
run_runner_test 'basictest/runner.rb', *args
903+
end
904+
private :test_basictest
905+
906+
def test_bootstraptest(*args)
907+
run_runner_test 'bootstraptest/runner.rb', *args
908+
end
909+
private :test_bootstraptest
910+
911+
def run_runner_test(runner, *args)
912+
double_dash_index = args.index '--'
913+
if double_dash_index
914+
args, runner_args = args[0...double_dash_index], args[(double_dash_index+1)..-1]
915+
else
916+
runner_args = []
917+
end
918+
run_ruby *args, "#{TRUFFLERUBY_DIR}/test/#{runner}", *runner_args
919+
end
920+
private :run_runner_test
921+
897922
def test_mri(*args)
898923
double_dash_index = args.index '--'
899924
if double_dash_index

0 commit comments

Comments
 (0)