Skip to content

Commit

Permalink
Showing 3 changed files with 21 additions and 26 deletions.
39 changes: 19 additions & 20 deletions test/jruby/compiler/test_jrubyc.rb
Original file line number Diff line number Diff line change
@@ -86,12 +86,11 @@ def test_require
File.delete("test_file1.class") rescue nil
end

def test_signature_with_arg_named_result
if RbConfig::CONFIG['bindir'].match( /!\//) || RbConfig::CONFIG['bindir'].match( /:\//)
skip( 'only filesystem installations of jruby can compile ruby to java' )
end
$compile_test = false
File.open("test_file2.rb", "w") {|file| file.write(<<-RUBY
# only filesystem installations of jruby can compile ruby to java
if !(RbConfig::CONFIG['bindir'].match( /!\//) || RbConfig::CONFIG['bindir'].match( /:\//))
def test_signature_with_arg_named_result
$compile_test = false
File.open("test_file2.rb", "w") {|file| file.write(<<-RUBY
class C
java_signature 'public int f(int result)'
def f(arg)
@@ -100,19 +99,19 @@ def f(arg)
end
C.new.f(0)
RUBY
)}

JRuby::Compiler::compile_argv(["--verbose", "--java", "--javac", "test_file2.rb"])
output = File.read(@tempfile_stderr.path)

assert_equal("", output)

assert_nothing_raised { require 'test_file2' }
assert($compile_test)
ensure
File.delete("test_file2.rb") rescue nil
File.delete("C.java") rescue nil
File.delete("C.class") rescue nil
RUBY
)}

JRuby::Compiler::compile_argv(["--verbose", "--java", "--javac", "test_file2.rb"])
output = File.read(@tempfile_stderr.path)
assert_equal("", output)
assert_nothing_raised { require 'test_file2' }
assert($compile_test)
ensure
File.delete("test_file2.rb") rescue nil
File.delete("C.java") rescue nil
File.delete("C.class") rescue nil
end
end
end
2 changes: 1 addition & 1 deletion test/jruby/test_load_compiled_ruby_class_from_classpath.rb
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@

require 'jruby/compiler'

class LoadCompiledRubyClassFromClasspathTest < Test::Unit::TestCase
class TestLoadCompiledRubyClassFromClasspath < Test::Unit::TestCase
include TestHelper

RubyName = "runner"
6 changes: 1 addition & 5 deletions test/pom.rb
Original file line number Diff line number Diff line change
@@ -170,9 +170,7 @@ def truffle_spec_config(spec_type, generate_report)
jar 'org.jruby:jruby-complete', '${project.version}', :scope => :provided

plugin :antrun do
# objectspace seems not to work at all here
# [ 'mri', 'jruby','objectspace', 'slow' ].each do |index|
[ 'mri', 'jruby', 'slow' ].each do |index|
[ 'mri', 'jruby','objectspace', 'slow' ].each do |index|
files = ""
File.open(File.join(basedir, index + '.index')) do |f|
f.each_line.each do |line|
@@ -182,8 +180,6 @@ def truffle_spec_config(spec_type, generate_report)
filename = "#{line.chomp}.rb" unless File.exist? File.join(basedir, filename)
next if filename =~ /mri\/psych\//
next if filename =~ /mri\/net\/http\//
# to much assumptions about executed from root directory, etc
next if filename =~ /jruby\/test_load_compiled_ruby_class_from_classpath.rb/
next unless File.exist? File.join(basedir, filename)
files << "<arg value='test/#{filename}'/>"
end

0 comments on commit adaf680

Please sign in to comment.