Skip to content

Commit

Permalink
[Truffle] Add --graal option to jt test mri
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Fish committed Oct 30, 2016
1 parent e733b87 commit 4d35ae3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tool/jt.rb
Expand Up @@ -458,6 +458,7 @@ def help
jt test run all mri tests, specs and integration tests (set SULONG_HOME, and maybe USE_SYSTEM_CLANG)
jt test tck [--jdebug] run the Truffle Compatibility Kit tests
jt test mri run mri tests
--graal use Graal (set either GRAALVM_BIN or GRAAL_HOME)
jt test specs run all specs
jt test specs fast run all specs except sub-processes, GC, sleep, ...
jt test spec/ruby/language run specs in this directory
Expand Down Expand Up @@ -779,6 +780,19 @@ def test_mri(*args)
}
jruby_args = %w[-J-Xmx2G -Xtruffle.exceptions.print_java]

if args.delete('--graal')
if ENV["RUBY_BIN"]
# Assume that Graal is automatically set up if RUBY_BIN is set.
# This will also warn if it's not.
else
javacmd, javacmd_options = Utilities.find_graal_javacmd_and_options
env_vars["JAVACMD"] = javacmd
jruby_args.push(*javacmd_options)
end
else
jruby_args << '-Xtruffle.graal.warn_unless=false'
end

This comment has been minimized.

Copy link
@eregon

eregon Nov 1, 2016

Member

You could just do jruby_args << '--graal' to let #run handle this I think.

This comment has been minimized.

Copy link
@eregon

eregon Nov 1, 2016

Member

Actually, does it not work without any special code here?

This comment has been minimized.

Copy link
@eregon

eregon Nov 1, 2016

Member

if args.empty?
args = File.readlines("#{JRUBY_DIR}/test/mri_truffle.index").grep(/^[^#]\w+/).map(&:chomp)
end
Expand Down

3 comments on commit 4d35ae3

@bjfish
Copy link
Contributor

@bjfish bjfish commented on 4d35ae3 Oct 30, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisseaton I thought this might be useful to run the openssl tests, e.g.:

jt test mri openssl/test_hmac.rb --graal

There's a list of these tests in the test index: https://github.com/jruby/jruby/blob/master/test/mri_truffle.index#L232

@chrisseaton
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the relationship between the test index and the test excludes? How do they work together?

@bjfish
Copy link
Contributor

@bjfish bjfish commented on 4d35ae3 Oct 31, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisseaton The tests in the index will not be loaded if they are commented out. So, it allows us to completely ignore test like truffle.mspec does for specs: https://github.com/jruby/jruby/blob/master/spec/truffle/truffle.mspec#L87. The index file applies when we run jt test mriwhere the index file is read by jt: https://github.com/jruby/jruby/blob/master/tool/jt.rb#L766. When an individual test is run, like jt test mri openssl/test_hmac.rb --graal, the index is not used.

The test excludes work like spec tags. They allow us to exclude individual tests. The excludes apply running both in individual and all mri tests.

Please sign in to comment.