Skip to content

Commit

Permalink
Showing 28 changed files with 318 additions and 88 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ matrix:
jdk: openjdk7
- env: TARGET='-Pj2ee'
jdk: oraclejdk7
- script: test/check_versions.sh
fast_finish: true
allow_failures:
- env: TARGET='-Pcomplete'
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.0.0.dev-SNAPSHOT
9.0.0.0-SNAPSHOT
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-core</artifactId>
<name>JRuby Core</name>
6 changes: 4 additions & 2 deletions core/src/main/java/org/jruby/RubyFileStat.java
Original file line number Diff line number Diff line change
@@ -122,15 +122,17 @@ private void setup(int fileno) {
}

private void setup(String filename, boolean lstat) {
Ruby runtime = getRuntime();

if (Platform.IS_WINDOWS && filename.length() == 2
&& filename.charAt(1) == ':' && Character.isLetter(filename.charAt(0))) {
filename += "/";
}

file = JRubyFile.createResource(getRuntime().getPosix(), getRuntime().getCurrentDirectory(), filename);
file = JRubyFile.createResource(runtime.getPosix(), runtime.getCurrentDirectory(), filename);
stat = lstat ? file.lstat() : file.stat();

if (stat == null) throw getRuntime().newErrnoFromInt(getRuntime().getPosix().errno());
if (stat == null) throw runtime.newErrnoFromInt(runtime.getPosix().errno(), filename);
}

public IRubyObject initialize(IRubyObject fname, Block unusedBlock) {
6 changes: 1 addition & 5 deletions core/src/main/java/org/jruby/RubyModule.java
Original file line number Diff line number Diff line change
@@ -1190,11 +1190,7 @@ public DynamicMethod searchMethodInner(String name) {

// The local method resolution logic. Overridden in IncludedModuleWrapper for recursion.
protected DynamicMethod searchMethodCommon(String name) {
DynamicMethod method = getMethods().get(name);

if (method != null) return method;

return superClass == null ? null : superClass.searchMethodInner(name);
return getMethods().get(name);
}

public void invalidateCacheDescendants() {
24 changes: 16 additions & 8 deletions core/src/main/java/org/jruby/RubyTime.java
Original file line number Diff line number Diff line change
@@ -46,6 +46,7 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.jcodings.specific.USASCIIEncoding;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormat;
@@ -92,10 +93,10 @@ public class RubyTime extends RubyObject {
// the legacy TZ format in order to convert it to the newer format
// understood by Java API.
private static final Pattern TZ_PATTERN
= Pattern.compile("([^-\\+\\d]+)?([\\+-]?)(\\d+)(?::(\\d+))?(?::\\d+)?");
= Pattern.compile("([^-\\+\\d]+)?([\\+-]?)(\\d+)(?::(\\d+))?(?::(\\d+))?");

private static final Pattern TIME_OFFSET_PATTERN
= Pattern.compile("([\\+-])(\\d\\d):(\\d\\d)");
= Pattern.compile("([\\+-])(\\d\\d):(\\d\\d)(?::(\\d\\d))?");

private static final ByteList TZ_STRING = ByteList.create("TZ");

@@ -169,13 +170,14 @@ private static DateTimeZone parseTZString(Ruby runtime, String zone) {
String sign = tzMatcher.group(2);
String hours = tzMatcher.group(3);
String minutes = tzMatcher.group(4);
String seconds= tzMatcher.group(5);

if (zoneName == null) {
zoneName = "";
}

// Sign is reversed in legacy TZ notation
return getTimeZoneFromHHMM(runtime, zoneName, sign.equals("-"), hours, minutes);
return getTimeZoneFromHHMM(runtime, zoneName, sign.equals("-"), hours, minutes, seconds);
} else {
if (LONG_TZNAME.containsKey(upZone)) {
zone = LONG_TZNAME.get(upZone);
@@ -228,7 +230,8 @@ public static DateTimeZone getTimeZoneFromUtcOffset(Ruby runtime, IRubyObject ut
String sign = offsetMatcher.group(1);
String hours = offsetMatcher.group(2);
String minutes = offsetMatcher.group(3);
dtz = getTimeZoneFromHHMM(runtime, "", !sign.equals("-"), hours, minutes);
String seconds = offsetMatcher.group(4);
dtz = getTimeZoneFromHHMM(runtime, "", !sign.equals("-"), hours, minutes, seconds);
} else {
IRubyObject numericOffset = numExact(runtime, utcOffset);
int newOffset = (int)Math.round(numericOffset.convertToFloat().getDoubleValue() * 1000);
@@ -292,18 +295,23 @@ private static void exactTypeError(Ruby runtime, IRubyObject received) {
String.format("Can't convert %s into an exact number", received.getMetaClass().getRealClass()));
}

private static DateTimeZone getTimeZoneFromHHMM(Ruby runtime, String name, boolean positive, String hours, String minutes) {
private static DateTimeZone getTimeZoneFromHHMM(Ruby runtime, String name, boolean positive, String hours, String minutes, String seconds) {
int h = Integer.parseInt(hours);
int m = 0;
int s = 0;
if (minutes != null) {
m = Integer.parseInt(minutes);
}

if (seconds != null) {
s = Integer.parseInt(seconds);
}

if (h > 23 || m > 59) {
throw runtime.newArgumentError("utc_offset out of range");
}

int offset = (positive ? +1 : -1) * ((h * 60) + m) * 60 * 1000;
int offset = (positive ? +1 : -1) * ((h * 3600) + m * 60 + s) * 1000;
return timeZoneWithOffset(name, offset);
}

@@ -683,7 +691,7 @@ public RubyString asctime() {
simpleDateFormat = TWO_DAY_CTIME_FORMATTER;
}
String result = simpleDateFormat.print(dt);
return getRuntime().newString(result);
return RubyString.newString(getRuntime(), result, USASCIIEncoding.INSTANCE);
}

@Override
@@ -716,7 +724,7 @@ private IRubyObject inspectCommon(DateTimeFormatter formatter, DateTimeFormatter
result = simpleDateFormat.print(invertedDT);
}

return getRuntime().newString(result);
return RubyString.newString(getRuntime(), result, USASCIIEncoding.INSTANCE);
}

@JRubyMethod
67 changes: 60 additions & 7 deletions core/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
Original file line number Diff line number Diff line change
@@ -1765,53 +1765,81 @@ public boolean includeObject(VirtualFrame frame, RubyArray array, Object value)
}

@CoreMethod(names = "initialize", needsBlock = true, required = 1, optional = 1)
public abstract static class InitializeNode extends ArrayCoreMethodNode {
@ImportGuards(ArrayGuards.class)
public abstract static class InitializeNode extends YieldingCoreMethodNode {

@Child protected ArrayBuilderNode arrayBuilder;

public InitializeNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
arrayBuilder = new ArrayBuilderNode.UninitializedArrayBuilderNode(context);
}

public InitializeNode(InitializeNode prev) {
super(prev);
arrayBuilder = prev.arrayBuilder;
}

@Specialization
public RubyArray initialize(RubyArray array, int size, UndefinedPlaceholder defaultValue) {
return initialize(array, size, getContext().getCoreLibrary().getNilObject());
public RubyArray initialize(RubyArray array, int size, UndefinedPlaceholder defaultValue, UndefinedPlaceholder block) {
return initialize(array, size, getContext().getCoreLibrary().getNilObject(), block);
}

@Specialization
public RubyArray initialize(RubyArray array, int size, int defaultValue) {
public RubyArray initialize(RubyArray array, int size, int defaultValue, UndefinedPlaceholder block) {
final int[] store = new int[size];
Arrays.fill(store, defaultValue);
array.setStore(store, size);
return array;
}

@Specialization
public RubyArray initialize(RubyArray array, int size, long defaultValue) {
public RubyArray initialize(RubyArray array, int size, long defaultValue, UndefinedPlaceholder block) {
final long[] store = new long[size];
Arrays.fill(store, defaultValue);
array.setStore(store, size);
return array;
}

@Specialization
public RubyArray initialize(RubyArray array, int size, double defaultValue) {
public RubyArray initialize(RubyArray array, int size, double defaultValue, UndefinedPlaceholder block) {
final double[] store = new double[size];
Arrays.fill(store, defaultValue);
array.setStore(store, size);
return array;
}

@Specialization
public RubyArray initialize(RubyArray array, int size, Object defaultValue) {
public RubyArray initialize(RubyArray array, int size, Object defaultValue, UndefinedPlaceholder block) {
final Object[] store = new Object[size];
Arrays.fill(store, defaultValue);
array.setStore(store, size);
return array;
}

@Specialization
public RubyArray initialize(VirtualFrame frame, RubyArray array, int size, UndefinedPlaceholder defaultValue, RubyProc block) {
Object store = arrayBuilder.start(size);

int count = 0;
try {
for (int n = 0; n < size; n++) {
if (CompilerDirectives.inInterpreter()) {
count++;
}

store = arrayBuilder.append(store, n, yield(frame, block, n));
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCountThroughBlocks(count);
}
}

array.setStore(arrayBuilder.finish(store, size), size);
return array;
}

}

@CoreMethod(names = "initialize_copy", visibility = Visibility.PRIVATE, required = 1)
@@ -2168,6 +2196,31 @@ public RubyArray mapLongFixnum(VirtualFrame frame, RubyArray array, RubyProc blo
return new RubyArray(getContext().getCoreLibrary().getArrayClass(), arrayBuilder.finish(mappedStore, arraySize), arraySize);
}

@Specialization(guards = "isFloat")
public RubyArray mapFloat(VirtualFrame frame, RubyArray array, RubyProc block) {
final double[] store = (double[]) array.getStore();
final int arraySize = array.getSize();
Object mappedStore = arrayBuilder.start(arraySize);

int count = 0;

try {
for (int n = 0; n < array.getSize(); n++) {
if (CompilerDirectives.inInterpreter()) {
count++;
}

mappedStore = arrayBuilder.append(mappedStore, n, yield(frame, block, store[n]));
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCountThroughBlocks(count);
}
}

return new RubyArray(getContext().getCoreLibrary().getArrayClass(), arrayBuilder.finish(mappedStore, arraySize), arraySize);
}

@Specialization(guards = "isObject")
public RubyArray mapObject(VirtualFrame frame, RubyArray array, RubyProc block) {
final Object[] store = (Object[]) array.getStore();
17 changes: 17 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/core/FloatNodes.java
Original file line number Diff line number Diff line change
@@ -368,6 +368,23 @@ public boolean equal(double a, BigInteger b) {
}
}

@CoreMethod(names = "<=>", required = 1)
public abstract static class CompareNode extends CoreMethodNode {

public CompareNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public CompareNode(CompareNode prev) {
super(prev);
}

@Specialization
public int compare(double a, double b) {
return Double.compare(a, b);
}
}

@CoreMethod(names = ">=", required = 1)
public abstract static class GreaterEqualNode extends CoreMethodNode {

Original file line number Diff line number Diff line change
@@ -1829,6 +1829,11 @@ public RubyNode visitPreExeNode(PreExeNode node) {
return node.getBodyNode().accept(this);
}

@Override
public RubyNode visitPostExeNode(PostExeNode node) {
return node.getBodyNode().accept(this);
}

@Override
public RubyNode visitRedoNode(org.jruby.ast.RedoNode node) {
return new RedoNode(context, translate(node.getPosition()));
15 changes: 5 additions & 10 deletions core/src/main/java/org/jruby/util/RubyDateFormatter.java
Original file line number Diff line number Diff line change
@@ -619,16 +619,11 @@ private String formatZone(int colons, int value, RubyTimeOutputFormatter formatt
after = ":" + mm + ":" + ss;
break;
case 3: // %:::z -> +hh[:mm[:ss]]
if (minutes == 0) {
if (seconds == 0) { // +hh
defaultWidth = 3;
after = "";
} else { // +hh:mm
return formatZone(1, value, formatter);
}
} else { // +hh:mm:ss
return formatZone(2, value, formatter);
}
StringBuilder sb = new StringBuilder();
if (minutes != 0 || seconds != 0) sb.append(":").append(mm);
if (seconds != 0) sb.append(":").append(ss);
after = sb.toString();
defaultWidth = after.length() + 3;
break;
}

4 changes: 2 additions & 2 deletions lib/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-lib</artifactId>
<packaging>pom</packaging>
@@ -20,7 +20,7 @@
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-core</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>rubygems</groupId>
2 changes: 1 addition & 1 deletion maven/jruby-complete/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-complete</artifactId>
<packaging>bundle</packaging>
6 changes: 1 addition & 5 deletions maven/jruby-dist/pom.rb
Original file line number Diff line number Diff line change
@@ -79,10 +79,6 @@

plugin( :invoker )

build do
final_name "#{model.artifact_id}-#{version.sub(/-SNAPSHOT/, '')}"
end

# for the release we do some extra IT by unzipping a source dist file
# and run the $ mvn -Pall from there and check a few things to be in place.
# add check for SNAPSHOT version in any of the modules !!!!
@@ -136,7 +132,7 @@

revision = `git show`.gsub( /\n.*|commit /, '' )

basefile = "#{ctx.project.build.directory}/#{ctx.project.artifactId}-#{ctx.project.version}-src".sub(/-SNAPSHOT/, '')
basefile = "#{ctx.project.build.directory}/#{ctx.project.artifactId}-#{ctx.project.version}-src"

FileUtils.cd( File.join( ctx.project.basedir.to_s, '..', '..' ) ) do
[ 'tar', 'zip' ].each do |format|
3 changes: 1 addition & 2 deletions maven/jruby-dist/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-dist</artifactId>
<packaging>pom</packaging>
@@ -27,7 +27,6 @@
</dependency>
</dependencies>
<build>
<finalName>jruby-dist-9.0.0.0.dev</finalName>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
2 changes: 1 addition & 1 deletion maven/jruby-jars/jruby-jars.gemspec
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ require 'rexml/xpath'
version = File.read( File.join( File.dirname(File.expand_path(__FILE__)), '..', '..', 'VERSION' ) ).strip

# this regexp can be refined to work with pre, rc1, rc2 and such cases
ruby_version = version.sub( /-SNAPSHOT$/, '.dev' ).sub( /.dev.dev/, '.dev' )
ruby_version = version.sub( /-SNAPSHOT$/, '.snapshot' )

File.open( 'lib/jruby-jars/version.rb', 'w' ) do |f|
f.print <<EOF
4 changes: 2 additions & 2 deletions maven/jruby-jars/lib/jruby-jars/version.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module JRubyJars
VERSION = '9.0.0.0.dev'
MAVEN_VERSION = '9.0.0.0.dev-SNAPSHOT'
VERSION = '9.0.0.0.SNAPSHOT'
MAVEN_VERSION = '9.0.0.0-SNAPSHOT'
end
6 changes: 3 additions & 3 deletions maven/jruby-jars/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<groupId>rubygems</groupId>
<artifactId>jruby-jars</artifactId>
@@ -67,7 +67,7 @@ freezing to) a specific jruby-complete jar version.</description>
</extension>
</extensions>
<directory>${basedir}/pkg</directory>
<finalName>${project.artifactId}-9.0.0.0.dev</finalName>
<finalName>${project.artifactId}-9.0.0.0.SNAPSHOT</finalName>
<plugins>
<plugin>
<groupId>de.saumya.mojo</groupId>
@@ -114,7 +114,7 @@ freezing to) a specific jruby-complete jar version.</description>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<properties>
<ruby.version>9.0.0.0.dev</ruby.version>
<ruby.version>9.0.0.0.SNAPSHOT</ruby.version>
<gem.home>${project.build.directory}/rubygems</gem.home>
<gem.path>${project.build.directory}/rubygems</gem.path>
</properties>
2 changes: 1 addition & 1 deletion maven/jruby-noasm/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-noasm</artifactId>
<name>JRuby Main Maven Artifact With ASM Relocated</name>
2 changes: 1 addition & 1 deletion maven/jruby-stdlib/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-stdlib</artifactId>
<name>JRuby Stdlib</name>
2 changes: 1 addition & 1 deletion maven/jruby/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-artifacts</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby</artifactId>
<name>JRuby Main Maven Artifact</name>
2 changes: 1 addition & 1 deletion maven/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-artifacts</artifactId>
<packaging>pom</packaging>
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
</parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JRuby</name>
<description>JRuby is the effort to recreate the Ruby (http://www.ruby-lang.org) interpreter in Java.</description>
1 change: 0 additions & 1 deletion spec/truffle/tags/language/class_tags.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
fails:A class definition allows the declaration of class variables in a class method
fails(inherited):A class definition extending an object (sclass) allows accessing the block of the original scope
fails:A class definition extending an object (sclass) can use return to cause the enclosing method to return
fails:Reopening a class adds new methods to subclasses
fails:class provides hooks calls inherited when a class is created
fails:Reopening a class raises a TypeError when superclasses mismatch
fails:A class definition allows the declaration of class variables in the body
72 changes: 72 additions & 0 deletions test/check_versions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# Checks that the artefacts produced by the JRuby build system have the correct
# names and versions.

jar_version=`cat VERSION`
gem_version=${jar_version/-/.}

rm -rf maven/*/target/*

mvn install -Pbootstrap
mvn -Pcomplete
mvn -Pdist
mvn -Pjruby-jars
mvn -Pjruby-tests
mvn -Pmain

declare -a failed
failed[0]=0

function check {
archive=$1
unpackaged=$2

if [ ! -f $archive ]
then
echo $archive was not found - check your version numbers
failed[0]=1
fi

if [[ $archive == *.tar.gz ]]
then
rm -rf $unpackaged
tar -zxf $archive

if [ ! -d $unpackaged ]
then
echo $archive did not untar to $unpackaged - check your version numbers
failed[0]=1
fi
fi

if [[ $archive == *.zip ]]
then
rm -rf $unpackaged
unzip -q $archive

if [ ! -d $unpackaged ]
then
echo $archive did not unzip to $unpackaged - check your version numbers
failed[0]=1
fi
fi
}

check test/target/jruby-tests-$jar_version.jar
check maven/jruby-stdlib/target/jruby-stdlib-$jar_version.jar
check maven/jruby-jars/pkg/jruby-jars-$gem_version.gem
check maven/jruby-jars/lib/jruby-core-$jar_version.jar
check maven/jruby-jars/lib/jruby-stdlib-$jar_version.jar
check maven/jruby-complete/target/jruby-complete-$jar_version.jar
check maven/jruby/target/jruby-$jar_version.jar
check maven/jruby-noasm/target/jruby-noasm-$jar_version.jar
check maven/jruby-dist/target/jruby-dist-$jar_version-bin.tar.gz jruby-$jar_version
check maven/jruby-dist/target/jruby-dist-$jar_version-src.tar.gz jruby-$jar_version
check maven/jruby-dist/target/jruby-dist-$jar_version-src.zip jruby-$jar_version
check maven/jruby-dist/target/jruby-dist-$jar_version-bin.zip jruby-$jar_version
check core/target/jruby-core-$jar_version-noasm.jar
check core/target/jruby-core-$jar_version.jar
check core/target/jruby-core-$jar_version-complete.jar

exit "${failed[0]}"
15 changes: 3 additions & 12 deletions test/mri/excludes/TestTime.rb
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
exclude :test_asctime, "needs investigation"
exclude :test_at, "needs investigation"
exclude :test_at_rational, "needs investigation"
exclude :test_at, "MRI uses less precision than JRuby, which causes it to produce incorrect values"
exclude :test_at_rational, "MRI uses less precision than JRuby, which causes it to produce incorrect values"
exclude :test_future, "needs investigation"
exclude :test_marshal_nsec_191, "needs investigation"
exclude :test_marshal_zone_gc, "should not be an issue on JRuby and slow"
exclude :test_new, "needs investigation"
exclude :test_past, "needs investigation"
exclude :test_plus_type, "needs investigation"
exclude :test_reinitialize, "needs investigation"
exclude :test_strftime, "needs investigation"
exclude :test_strfimte_zoneoffset, "needs investigation"
exclude :test_strftime_invalid_flags, "needs investigation"
exclude :test_strftime_padding, "needs investigation"
exclude :test_strftime_rational, "needs investigation"
exclude :test_strftime_too_wide, "needs investigation"
exclude :test_time_add, "needs investigation"
exclude :test_time_interval, "needs investigation"
exclude :test_to_r, "needs investigation"
exclude :test_to_s, "needs investigation"
exclude :test_utc_or_local, "needs investigation"
exclude :test_utc_or_local, "needs investigation"
2 changes: 1 addition & 1 deletion test/pom.rb
Original file line number Diff line number Diff line change
@@ -132,7 +132,7 @@
execute_goals( 'run',
:id => 'rake',
:phase => 'test',
:configuration => [ xml( '<target><exec dir="${jruby.home}" executable="${jruby.home}/bin/jruby" failonerror="true"><arg value="-S"/><arg value="rake"/><arg value="${task}"/></exec></target>' ) ] )
:configuration => [ xml( '<target><exec dir="${jruby.home}" executable="${jruby.home}/bin/jruby" failonerror="true"><env key="JRUBY_OPTS" value=""/><arg value="-S"/><arg value="rake"/><arg value="${task}"/></exec></target>' ) ] )
end

end
106 changes: 100 additions & 6 deletions test/pom.xml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.0.0.0.dev-SNAPSHOT</version>
<version>9.0.0.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-tests</artifactId>
<name>JRuby Integration Tests</name>
@@ -240,7 +240,8 @@
</goals>
<configuration>
<target>
<exec failonerror="true" dir="${jruby.home}" executable="${jruby.home}/bin/jruby">
<exec dir="${jruby.home}" executable="${jruby.home}/bin/jruby" failonerror="true">
<env value="" key="JRUBY_OPTS" />
<arg value="-S" />
<arg value="rake" />
<arg value="${task}" />
@@ -268,12 +269,105 @@
</goals>
<configuration>
<target>
<exec failonerror="true" dir="${jruby.home}" executable="java">
<exec dir="${jruby.home}" executable="java" failonerror="true">
<arg value="-cp" />
<arg value="core/target/test-classes:test/target/test-classes:maven/jruby-complete/target/jruby-complete-${project.version}.jar" />
<arg value="org.jruby.Main" />
<arg value="-I." />
<arg value="" />
<arg value="test/jruby/test_globals.rb" />
<arg value="test/jruby/test_argf.rb" />
<arg value="test/jruby/test_array.rb" />
<arg value="test/jruby/test_autoload.rb" />
<arg value="test/jruby/test_backquote.rb" />
<arg value="test/jruby/test_backtraces.rb" />
<arg value="test/jruby/test_big_decimal.rb" />
<arg value="test/jruby/test_binding_eval_yield.rb" />
<arg value="test/jruby/test_caller.rb" />
<arg value="test/jruby/test_case.rb" />
<arg value="test/jruby/test_class.rb" />
<arg value="test/jruby/test_comparable.rb" />
<arg value="test/jruby/test_core_arities.rb" />
<arg value="test/jruby/test_custom_enumerable.rb" />
<arg value="test/jruby/test_cvars_in_odd_scopes.rb" />
<arg value="test/jruby/test_date_joda_time.rb" />
<arg value="test/jruby/test_defined.rb" />
<arg value="test/jruby/test_default_constants.rb" />
<arg value="test/jruby/test_delegated_array_equals.rb" />
<arg value="test/jruby/test_dir.rb" />
<arg value="test/jruby/test_dir_with_jar_without_dir_entry.rb" />
<arg value="test/jruby/test_digest_extend.rb" />
<arg value="test/jruby/test_digest2.rb" />
<arg value="test/jruby/test_env.rb" />
<arg value="test/jruby/test_etc.rb" />
<arg value="test/jruby/test_file.rb" />
<arg value="test/jruby/test_flip.rb" />
<arg value="test/jruby/test_frame_self.rb" />
<arg value="test/jruby/test_hash.rb" />
<arg value="test/jruby/test_higher_javasupport.rb" />
<arg value="test/jruby/test_included_in_object_space.rb" />
<arg value="test/jruby/test_integer_overflows.rb" />
<arg value="test/jruby/test_ivar_table_integrity.rb" />
<arg value="test/jruby/test_io.rb" />
<arg value="test/jruby/test_load.rb" />
<arg value="test/jruby/test_method.rb" />
<arg value="test/jruby/test_method_cache.rb" />
<arg value="test/jruby/test_method_override_and_caching.rb" />
<arg value="test/jruby/test_java_accessible_object.rb" />
<arg value="test/jruby/test_java_extension.rb" />
<arg value="test/jruby/test_java_wrapper_deadlock.rb" />
<arg value="test/jruby/test_jruby_internals.rb" />
<arg value="test/jruby/test_marshal_with_instance_variables.rb" />
<arg value="test/jruby/test_marshal_gemspec.rb" />
<arg value="test/jruby/test_method_missing.rb" />
<arg value="test/jruby/test_no_stack_trace_stomp.rb" />
<arg value="test/jruby/test_pack.rb" />
<arg value="test/jruby/test_primitive_to_java.rb" />
<arg value="test/jruby/test_process.rb" />
<arg value="test/jruby/test_proc_visibility.rb" />
<arg value="test/jruby/test_parsing.rb" />
<arg value="test/jruby/test_pathname_dup.rb" />
<arg value="test/jruby/test_random.rb" />
<arg value="test/jruby/test_rbconfig.rb" />
<arg value="test/jruby/test_require_once.rb" />
<arg value="test/jruby/test_respond_to.rb" />
<arg value="test/jruby/test_socket.rb" />
<arg value="test/jruby/test_string_java_bytes.rb" />
<arg value="test/jruby/test_string_printf.rb" />
<arg value="test/jruby/test_string_to_number.rb" />
<arg value="test/jruby/test_super_call_site_caching.rb" />
<arg value="test/jruby/test_system.rb" />
<arg value="test/jruby/test_system_error.rb" />
<arg value="test/jruby/test_timeout.rb" />
<arg value="test/jruby/test_thread.rb" />
<arg value="test/jruby/test_threaded_nonlocal_return.rb" />
<arg value="test/jruby/test_time_add.rb" />
<arg value="test/jruby/test_time_nil_ops.rb" />
<arg value="test/jruby/test_time_tz.rb" />
<arg value="test/jruby/test_unmarshal.rb" />
<arg value="test/jruby/test_vietnamese_charset.rb" />
<arg value="test/jruby/test_win32.rb" />
<arg value="test/jruby/test_zlib.rb" />
<arg value="test/jruby/test_loading_builtin_libraries.rb" />
<arg value="test/jruby/test_null_channel.rb" />
<arg value="test/jruby/test_irubyobject_java_passing.rb" />
<arg value="test/jruby/test_jruby_object_input_stream.rb" />
<arg value="test/jruby/test_jar_on_load_path.rb" />
<arg value="test/jruby/test_jruby_ext.rb" />
<arg value="test/jruby/test_jruby_core_ext.rb" />
<arg value="test/jruby/test_thread_context_frame_dereferences_unreachable_variables.rb" />
<arg value="test/jruby/test_context_classloader.rb" />
<arg value="test/jruby/test_rexml_document.rb" />
<arg value="test/jruby/test_openssl_stub.rb" />
<arg value="test/jruby/test_missing_jruby_home.rb" />
<arg value="test/jruby/test_jarred_gems_with_spaces_in_directory.rb" />
<arg value="test/jruby/test_kernel.rb" />
<arg value="test/jruby/test_dir_with_plusses.rb" />
<arg value="test/jruby/test_jar_file.rb" />
<arg value="test/jruby/test_jruby_synchronized.rb" />
<arg value="test/jruby/test_instantiating_interfaces.rb" />
<arg value="test/jruby/test_openssl.rb" />
<arg value="test/jruby/test_tempfile_cleanup.rb" />
<arg value="-v" />
</exec>
</target>
@@ -307,7 +401,7 @@
</goals>
<configuration>
<target>
<exec failonerror="true" dir="${jruby.home}" executable="${jruby.home}/bin/jruby">
<exec dir="${jruby.home}" executable="${jruby.home}/bin/jruby" failonerror="true">
<arg value="-X+T" />
<arg value="-Xparser.warn.useless_use_of=false" />
<arg value="-Xparser.warn.not_reached=false" />
@@ -349,7 +443,7 @@
</goals>
<configuration>
<target>
<exec failonerror="true" dir="${jruby.home}" executable="${jruby.home}/bin/jruby">
<exec dir="${jruby.home}" executable="${jruby.home}/bin/jruby" failonerror="true">
<arg value="-X+T" />
<arg value="-Xparser.warn.useless_use_of=false" />
<arg value="-Xparser.warn.not_reached=false" />
@@ -391,7 +485,7 @@
</goals>
<configuration>
<target>
<exec failonerror="true" dir="${jruby.home}" executable="${jruby.home}/bin/jruby">
<exec dir="${jruby.home}" executable="${jruby.home}/bin/jruby" failonerror="true">
<arg value="-J-server" />
<arg value="-J-G:+TruffleCompilationExceptionsAreThrown" />
<arg value="-X+T" />
28 changes: 15 additions & 13 deletions tool/build-graal-bundles.sh
Original file line number Diff line number Diff line change
@@ -13,32 +13,30 @@

# Run in the root directory. Run -Pdist first.

#version=`cat VERSION`
version_file=9.0.0.0.dev
version_dir=9.0.0.0.dev-SNAPSHOT
version=`cat VERSION`

tar -zxf maven/jruby-dist/target/jruby-dist-$version_file-bin.tar.gz || exit $?
tar -zxf maven/jruby-dist/target/jruby-dist-$version-bin.tar.gz || exit $?

# Remove files we aren't going to patch so people don't use them by mistake

rm jruby-$version_dir/bin/*.bat jruby-$version_dir/bin/*.sh jruby-$version_dir/bin/*.bash jruby-$version_dir/bin/*.exe jruby-$version_dir/bin/*.dll || exit $?
rm jruby-$version/bin/*.bat jruby-$version/bin/*.sh jruby-$version/bin/*.bash jruby-$version/bin/*.exe jruby-$version/bin/*.dll || exit $?

# Patch the jruby bash script to set JAVACMD and JRUBY_OPTS

sed -i.backup 's|if \[ -z "\$JAVACMD" \] ; then|# Modifications for distribution with Graal\
JAVACMD=\"\$JRUBY_HOME/graalvm-jdk1.8.0/bin/java\"\
JRUBY_OPTS=\"-J-server -J-d64 \$JRUBY_OPTS\"\
\
if [ -z "$JAVACMD" ] ; then|' jruby-$version_dir/bin/jruby || exit $?
if [ -z "$JAVACMD" ] ; then|' jruby-$version/bin/jruby || exit $?

if diff jruby-$version_dir/bin/jruby jruby-$version_dir/bin/jruby.backup >/dev/null ; then
if diff jruby-$version/bin/jruby jruby-$version/bin/jruby.backup >/dev/null ; then
echo "patch didn't work"
exit 1
fi

rm jruby-$version_dir/bin/jruby.backup || exit $?
rm jruby-$version/bin/jruby.backup || exit $?

chmod +x jruby-$version_dir/bin/jruby || exit $?
chmod +x jruby-$version/bin/jruby || exit $?

function pack {
# $1 ... platform (linux, ...)
@@ -54,10 +52,14 @@ function pack {

tar -zxf $buildname || exit $?
chmod -R +w graalvm-jdk1.8.0
cp -r graalvm-jdk1.8.0 jruby-$version_dir || exit $?
rm -rf jruby-$version_dir/graalvm-jdk1.8.0/src.zip jruby-$version_dir/graalvm-jdk1.8.0/demo jruby-$version_dir/graalvm-jdk1.8.0/include jruby-$version_dir/graalvm-jdk1.8.0/sample || exit $?
targetname=jruby-dist-$version_file+graal-$1-x86_64-bin.tar.gz
tar -zcf $targetname jruby-$version_dir || exit $?
cp -r graalvm-jdk1.8.0 jruby-$version || exit $?
rm -rf jruby-$version/graalvm-jdk1.8.0/src.zip jruby-$version/graalvm-jdk1.8.0/demo jruby-$version/graalvm-jdk1.8.0/include jruby-$version/graalvm-jdk1.8.0/sample || exit $?
targetname=jruby-dist-$version+graal-$1-x86_64-bin.tar.gz
tar -zcf $targetname jruby-$version || exit $?
shasum -a 1 $targetname > $targetname.sha1 || exit $?
cp -r jruby-$version jruby-master || exit $?
targetname=jruby-dist-master+graal-$1-x86_64-bin.tar.gz
tar -zcf $targetname jruby-master || exit $?
shasum -a 1 $targetname > $targetname.sha1 || exit $?
}

0 comments on commit 506c427

Please sign in to comment.