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: 16b13e1cca6d
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ef56ae4b1f3c
Choose a head ref
  • 2 commits
  • 5 files changed
  • 1 contributor

Commits on Jan 27, 2016

  1. Copy the full SHA
    2e5e942 View commit details
  2. separate filename selection from index on test/jruby and test/mri in …

    …IT tests
    
    ... there are some test names that are the same and thus one excludes another
    kares committed Jan 27, 2016
    Copy the full SHA
    ef56ae4 View commit details
71 changes: 33 additions & 38 deletions maven/jruby/src/it/extended/src/test/java/org/example/BaseTest.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
package org.example;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.io.File;
import java.io.StringWriter;
import java.net.URL;
import java.net.URLClassLoader;

import org.jruby.embed.LocalContextScope;
import org.jruby.embed.ScriptingContainer;

import org.junit.Before;
import org.junit.Test;

public class BaseTest {

private final String basedir = new File( System.getProperty("basedir"), "../../../../../" ).getAbsolutePath();
@@ -31,38 +25,39 @@ private void runTests(ScriptingContainer container) throws Exception {
container.terminate();
}

private void collectTests(ScriptingContainer container, String index) throws Exception {
container.runScriptlet("File.open(File.join('test', '" + index + ".index')) do |f|\n" +
" f.each_line.each do |line|\n" +
" next if line =~ /^#/ or line.strip.empty?\n" +
" filename = \"test/mri/#{line.chomp}\"\n" +
" filename = \"test/jruby/#{line.chomp}.rb\" unless File.exist? filename\n" +
" filename = \"test/#{line.chomp}.rb\" unless File.exist? filename\n" +
" next unless File.file? filename\n" +
" next if filename =~ /mri\\/net\\/http\\//\n" +
" next if filename =~ /mri\\/ruby\\/test_class/\n" +
" next if filename =~ /mri\\/ruby\\/test_io/\n" +
" next if filename =~ /mri\\/ruby\\/test_econv/\n" +
// TODO find a way to obey the minitest/excludes and get those back
" next if filename =~ /psych\\/test_encoding.rb/\n" +
" next if filename =~ /psych\\/test_parser.rb/\n" +
" next if filename =~ /psych\\/test_psych.rb/\n" +
" next if filename =~ /psych\\/visitors\\/test_yaml_tree.rb/\n" +
" next if filename =~ /psych\\/test_document.rb/\n" +
" next if filename =~ /psych\\/test_tree_builder.rb/\n" +
" next if filename =~ /psych\\/test_date_time.rb/\n" +
" next if filename =~ /psych\\/test_nil.rb/\n" +
// TODO file an issue or so
" next if filename =~ /test_load_compiled_ruby.rb/\n" +
" next if filename =~ /compiler\\/test_jrubyc.rb/\n" +
// TODO remove the following after fix of #2215
" next if filename =~ /test_jar_on_load_path.rb/\n" +
" next if filename =~ /test_file.rb/\n" +
" filename.sub!( /.*\\/test\\//, 'test/' )\n" +
" puts filename\n" +
" require filename\n" +
" end\n" +
" end");
protected void collectTests(ScriptingContainer container, String index) throws Exception {
container.runScriptlet(
"File.open(File.join('test', '" + index + ".index')) do |f|\n" +
" f.each_line do |line|\n" +
" next if line =~ /^#/ or line.strip.empty?\n" +
" filename = \"test/mri/#{line.chomp}\"\n" +
" filename = \"test/jruby/#{line.chomp}.rb\" unless File.exist? filename\n" +
" filename = \"test/#{line.chomp}.rb\" unless File.exist? filename\n" +
" next unless File.file? filename\n" +
" next if filename =~ /mri\\/net\\/http\\//\n" +
" next if filename =~ /mri\\/ruby\\/test_class/\n" +
" next if filename =~ /mri\\/ruby\\/test_io/\n" +
" next if filename =~ /mri\\/ruby\\/test_econv/\n" +
// TODO find a way to obey the minitest/excludes and get those back
" next if filename =~ /psych\\/test_encoding.rb/\n" +
" next if filename =~ /psych\\/test_parser.rb/\n" +
" next if filename =~ /psych\\/test_psych.rb/\n" +
" next if filename =~ /psych\\/visitors\\/test_yaml_tree.rb/\n" +
" next if filename =~ /psych\\/test_document.rb/\n" +
" next if filename =~ /psych\\/test_tree_builder.rb/\n" +
" next if filename =~ /psych\\/test_date_time.rb/\n" +
" next if filename =~ /psych\\/test_nil.rb/\n" +
// TODO file an issue or so
" next if filename =~ /test_load_compiled_ruby.rb/\n" +
" next if filename =~ /compiler\\/test_jrubyc.rb/\n" +
// TODO remove the following after fix of #2215
" next if filename =~ /test_jar_on_load_path.rb/\n" +
" next if filename =~ /test_file.rb/\n" +
" filename.sub!( /.*\\/test\\//, 'test/' )\n" +
" puts filename\n" +
" require filename\n" +
" end\n" +
" end" );
}

void runIt(String index) throws Exception {
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
package org.example;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.io.File;
import java.io.StringWriter;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.Test;

import org.jruby.embed.LocalContextScope;
import org.jruby.embed.ScriptingContainer;

import org.junit.Before;
import org.junit.Test;

public class JRubyTest extends BaseTest {

@Test
public void testJRuby() throws Exception {
runIt("jruby");
}

protected void collectTests(ScriptingContainer container, String index) {
container.runScriptlet(
"File.open(File.join('test', '" + index + ".index')) do |f|\n" +
" f.each_line do |line|\n" +
" next if line =~ /^#/ or line.strip.empty?\n" +
" filename = \"test/jruby/#{line.chomp}.rb\"\n" +
" filename = \"test/#{line.chomp}.rb\" unless File.exist? filename\n" +
" next unless File.file? filename\n" +

// TODO file an issue or so
" next if filename =~ /test_load_compiled_ruby.rb/\n" +
" next if filename =~ /compiler\\/test_jrubyc.rb/\n" +
// TODO remove the following after fix of #2215
" next if filename =~ /test_jar_on_load_path.rb/\n" +
" next if filename =~ /test_file.rb/\n" +

" filename.sub!( /.*\\/test\\//, 'test/' )\n" +
" puts filename\n" +
" require filename\n" +
" end\n" +
" end" );
}

}
43 changes: 32 additions & 11 deletions maven/jruby/src/it/extended/src/test/java/org/example/MRITest.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
package org.example;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.io.File;
import java.io.StringWriter;
import java.net.URL;
import java.net.URLClassLoader;
import org.junit.Test;

import org.jruby.embed.LocalContextScope;
import org.jruby.embed.ScriptingContainer;

import org.junit.Before;
import org.junit.Test;

public class MRITest extends BaseTest {

@Test
public void testMRI() throws Exception {
runIt("mri", "ENV['EXCLUDE_DIR']='test/mri/excludes';");
}

protected void collectTests(ScriptingContainer container, String index) {
container.runScriptlet(
"File.open(File.join('test', '" + index + ".index')) do |f|\n" +
" f.each_line do |line|\n" +
" next if line =~ /^#/ or line.strip.empty?\n" +
" filename = \"test/mri/#{line.chomp}\"\n" +
" filename = \"test/#{line.chomp}.rb\" unless File.exist? filename\n" +
" next unless File.file? filename\n" +

" next if filename =~ /mri\\/net\\/http\\//\n" +
" next if filename =~ /mri\\/ruby\\/test_class/\n" +
" next if filename =~ /mri\\/ruby\\/test_io/\n" +
" next if filename =~ /mri\\/ruby\\/test_econv/\n" +
// TODO find a way to obey the minitest/excludes and get those back
" next if filename =~ /psych\\/test_encoding.rb/\n" +
" next if filename =~ /psych\\/test_parser.rb/\n" +
" next if filename =~ /psych\\/test_psych.rb/\n" +
" next if filename =~ /psych\\/visitors\\/test_yaml_tree.rb/\n" +
" next if filename =~ /psych\\/test_document.rb/\n" +
" next if filename =~ /psych\\/test_tree_builder.rb/\n" +
" next if filename =~ /psych\\/test_date_time.rb/\n" +
" next if filename =~ /psych\\/test_nil.rb/\n" +

" filename.sub!( /.*\\/test\\//, 'test/' )\n" +
" puts filename\n" +
" require filename\n" +
" end\n" +
" end" );
}

}
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
package org.example;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.io.File;
import java.io.StringWriter;
import java.net.URL;
import java.net.URLClassLoader;

import org.jruby.embed.LocalContextScope;
import org.jruby.embed.ScriptingContainer;

import org.junit.Before;
import org.junit.Test;

public class ObjectspaceTest extends BaseTest {
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
package org.example;

import static org.junit.Assert.assertEquals;

import java.util.Arrays;
import java.io.File;
import java.io.StringWriter;
import java.net.URL;
import java.net.URLClassLoader;

import org.jruby.embed.LocalContextScope;
import org.jruby.embed.ScriptingContainer;

import org.junit.Before;
import org.junit.Test;

public class SlowTest extends BaseTest {