Make regress tests work.

Set JAVA_HOME and PATH and disable forking so java doesn't crash when
running the test and spec tasks.  Don't install the jruby-launcher gem
when running the test and spec tasks, as it fails.

Regress depend on git when running the specs, as it needs to download
current rubyspecs for the spec task.

Delete the jruby-complete.jar file and just use the jruby.jar file
when running the specs, as otherwise you get additional test failures
and warnings.

Switch to SUBST_CMD while here now that has been fixed. Also, bump
the memory limits by 50M as 384M doesn't seem to be enough in all
cases.
This commit is contained in:
jeremy 2011-11-14 11:38:16 +00:00
parent fa30e48d90
commit f10ffb527c
2 changed files with 53 additions and 13 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.26 2011/11/08 23:47:20 jeremy Exp $
# $OpenBSD: Makefile,v 1.27 2011/11/14 11:38:16 jeremy Exp $
SHARED_ONLY = Yes
@ -36,13 +36,14 @@ BUILD_DEPENDS = devel/apache-ant \
${RUN_DEPENDS}
RUN_DEPENDS = java/javaPathHelper
MAKE_ENV = JAVA_HOME=${JAVA_HOME} ANT_OPTS="-Xms384m -Xmx384m" \
MAKE_ENV = JAVA_HOME=${JAVA_HOME} ANT_OPTS="-Xms434m -Xmx434m" \
MAKE=${MAKE_PROGRAM}
JRUBY_HOME = ${PREFIX}/jruby
WRKDIST = ${WRKDIR}/jruby-${V}
ANT_CMD = ${SETENV} ${MAKE_ENV} ${LOCALBASE}/bin/ant
ANT_CMD = ${SETENV} ${MAKE_ENV} PATH=${JAVA_HOME}/bin:${PATH} \
${LOCALBASE}/bin/ant
JFFI_HOME = ${WRKDIST}/jffi
JFFI_ARCH = ${MACHINE_ARCH:S/amd64/x86_64/}-OpenBSD
FFI_ARCH = ${JFFI_ARCH:L}
@ -59,9 +60,7 @@ post-extract:
&& cd jruby-launcher && tar zxf ../data.tar.gz
pre-configure:
# SUBST_CMD causes problems because $\( -> $(
perl -pi -e 's,\$$\{LOCALBASE\},'${LOCALBASE}',g' \
${WRKSRC}/lib/ruby/site_ruby/shared/mkmf.rb \
${SUBST_CMD} ${WRKSRC}/lib/ruby/site_ruby/shared/mkmf.rb \
${WRKSRC}/jruby-launcher/unixlauncher.cpp
# Rebuild the jruby-launcher gem
cd ${WRKSRC}/jruby-launcher && find . -type f \! -name '*.orig' -print | \
@ -110,8 +109,19 @@ do-install:
mkdir -p ${JRUBY_HOME}/lib/ruby/site_ruby/1.8/java
chown -R ${SHAREOWN}:${SHAREGRP} ${JRUBY_HOME}/lib ${JRUBY_HOME}/share
REGRESS_DEPENDS = devel/git
ANT_REGRESS_CMD = ${SETENV} ${MAKE_ENV} HOME=${WRKBUILD} \
PATH=${JAVA_HOME}/bin:${PATH} \
${LOCALBASE}/bin/ant
# Expected test failures:
# 4 Failures in JRubyTestSuite
# 1 Failure in MainTestSuite
# 1 Failure in MRITestSuite
# 41 spec failures, 2 errors, but this grabs the latest specs via git, so it
# can change.
do-regress:
cd ${WRKSRC} && ${ANT_CMD} test
cd ${WRKSRC} && ${ANT_CMD} spec
rm -f ${WRKSRC}/lib/jruby-complete.jar
-cd ${WRKSRC} && ${ANT_REGRESS_CMD} test
cd ${WRKSRC} && ${ANT_REGRESS_CMD} spec
.include <bsd.port.mk>

View File

@ -1,10 +1,17 @@
$OpenBSD: patch-build_xml,v 1.3 2011/11/08 23:58:08 jeremy Exp $
$OpenBSD: patch-build_xml,v 1.4 2011/11/14 11:38:16 jeremy Exp $
Fix build, backported from git commit
a760b4aea4b5aa9b38da4bd3334d8355a83f60fa.
Fix build by removing ri cache generation, backported from git
commit a760b4aea4b5aa9b38da4bd3334d8355a83f60fa.
--- build.xml.orig Sun Oct 30 20:59:44 2011
+++ build.xml Sun Oct 30 21:01:00 2011
Don't install the jruby launcher when running the regress specs,
as it fails due to a make error and it isn't necessary for the
regress tests.
Also, don't fork for the regress tests, as otherwise the JVM
exits abnormally.
--- build.xml.orig Tue Oct 25 16:54:51 2011
+++ build.xml Sun Nov 13 23:49:50 2011
@@ -379,7 +379,6 @@
</jar>
@ -21,3 +28,26 @@ a760b4aea4b5aa9b38da4bd3334d8355a83f60fa.
</target>
<target name="jarjar" depends="jar-jruby-dist"/>
@@ -806,13 +804,6 @@
<env key="GEM_PATH" value=""/> <!-- to ignore any gems installed in ~/.gem -->
<arg line="-S gem uninstall --all jruby-launcher"/>
</java>
- <java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true">
- <classpath refid="build.classpath"/>
- <classpath path="${jruby.classes.dir}"/>
- <sysproperty key="jruby.home" value="${basedir}"/>
- <env key="GEM_PATH" value=""/> <!-- to ignore any gems installed in ~/.gem -->
- <arg line="-S gem install ${jruby.launcher.gem}"/>
- </java>
</target>
<target name="test" depends="
@@ -967,7 +958,7 @@
<echo message="compile=@{compile.mode}, jit.threshold=@{jit.threshold}, jit.maxsize=@{jit.maxsize}, jit.max=@{jit.max}, objectspace=@{objectspace.enabled} threadpool=@{thread.pooling} reflection=@{reflection} version=@{jruby.version}"/>
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" classpath="${build.lib.dir}/junit.jar"/>
- <junit jvm="${jruby.test.jvm}" fork="yes" forkMode="once" haltonfailure="true" dir="${basedir}" maxmemory="${jruby.test.memory}" showoutput="true" timeout="1800000">
+ <junit jvm="${jruby.test.jvm}" haltonfailure="false" dir="${basedir}" maxmemory="${jruby.test.memory}" showoutput="true" timeout="1800000">
<classpath refid="test.class.path"/>
<sysproperty key="java.awt.headless" value="true"/>