Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0596e576d59b
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1e9a59d0da9e
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Sep 8, 2015

  1. Copy the full SHA
    1320fc9 View commit details
  2. Copy the full SHA
    1e9a59d View commit details
Showing with 26 additions and 7 deletions.
  1. +15 −6 test/truffle/pe/pe.rb
  2. +11 −1 tool/truffle/jruby_truffle_runner/lib/jruby+truffle_runner.rb
21 changes: 15 additions & 6 deletions test/truffle/pe/pe.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2014, 2015 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1
@@ -61,9 +61,14 @@ def tagged_example(code)
errored = 0
timedout = 0

def report(status, code, message = nil)
format_str = '%7s: %s'
puts message ? format(format_str + "\n %s", status, code, message) : format('%7s: %s', status, code)
end

EXAMPLES.each do |code, expected_constant, tagged|
next if tagged

finished = false

test_thread = Thread.new do
@@ -80,18 +85,22 @@ def tagged_example(code)
end

if constant.nil?
puts "ERROR: #{code} errored in some unexpected way: #{e.message}"
report 'ERROR', code, "errored in some unexpected way: #{e.message}"
errored += 1
else
if expected_constant
unless constant
puts "FAILURE: #{code} wasn't constant"
report 'FAILED', code, "wasn't constant"
failed += 1
else
report 'OK', code
end
else
if constant
puts "QUERY: #{code} wasn't supposed to be constant but it was"
report 'QUERY', code, "wasn't supposed to be constant but it was"
failed += 1
else
report 'OK', code
end
end
end
@@ -103,7 +112,7 @@ def tagged_example(code)
test_thread.join(5)

unless finished
puts "TIMEOUT: #{code} didn't compile in time so I don't know if it's constant or not"
report 'TIMEOUT', code, "didn't compile in time so I don't know if it's constant or not"
timedout += 1
end
end
12 changes: 11 additions & 1 deletion tool/truffle/jruby_truffle_runner/lib/jruby+truffle_runner.rb
Original file line number Diff line number Diff line change
@@ -56,6 +56,8 @@ class JRubyTruffleRunner
help: ['-h', '--help', 'Show this message', assign_new_value, false],
test: ['-t', '--test', 'Do not use Truffle use plain JRuby', assign_new_value, false],
graal: ['-g', '--graal', 'Run on graal', assign_new_value, false],
build: ['-b', '--build', 'Run `jt build` in JRuby', assign_new_value, false],
rebuild: ['--rebuild', 'Run `jt rebuild` in JRuby', assign_new_value, false],
debug: ['-d', '--debug', 'JVM remote debugging', assign_new_value, false],
require: ['-r', '--require FILE', 'Files to require, same as Ruby\'s -r', add_to_array, []],
load_path: ['-I', '--load-path LOAD_PATH', 'Paths to add to load path, same as Ruby\'s -I', add_to_array, []],
@@ -275,9 +277,17 @@ def subcommand_setup(rest)
end

def subcommand_run(rest)
core_load_path = Pathname("#{@options[:global][:jruby_truffle_path]}/../../truffle/src/main/ruby").
jruby_path = Pathname("#{@options[:global][:jruby_truffle_path]}/../..").
relative_path_from(Pathname('.')).to_s

if @options[:run][:build] || @options[:run][:rebuild]
Dir.chdir jruby_path do
execute_cmd "./tool/jt.rb #{'re' if @options[:run][:rebuild]}build"
end
end

core_load_path = "#{jruby_path}/truffle/src/main/ruby"

cmd_options = [
*(['-X+T', "-Xtruffle.core.load_path=#{core_load_path}"] unless @options[:run][:test]),
(format(@options[:global][:debug_option], @options[:global][:debug_port]) if @options[:run][:debug]),