Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d8b91a00f2
Fetching contributors…

Cannot retrieve contributors at this time

313 lines (278 sloc) 14.481 kb
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="..">
<import file="../build.xml"/>
<target name="compile-test" depends="jar" description="Compile the unit tests">
<javac destdir="${test.classes.dir}" deprecation="true" encoding="UTF-8" debug="true"
source="${javac.version}" target="${javac.version}" includeantruntime="false">
<classpath>
<path refid="jruby.execute.classpath"/>
<pathelement path="${lib.dir}/jruby.jar"/>
</classpath>
<src path="${test.dir}"/>
<src path="${spec.dir}"/>
<patternset refid="java.src.pattern"/>
</javac>
</target>
<target name="copy-test-files" depends="compile-test"
description="Make tests fails available as resources">
<copy todir="${test.classes.dir}">
<fileset dir="${test.dir}" includes="org/**/*.rb"/>
</copy>
</target>
<target name="test" depends="
copy-test-files,
install-gems,
run-junit-interpreted-short,
test-rake-targets"
description="Runs unit tests.">
</target>
<target name="test-debug" depends="
copy-test-files,
install-gems,
run-junit-interpreted-short-debug,
test-rake-targets"
description="Runs unit tests, connecting to port 5001 via dt_socket">
</target>
<target name="test-extended" depends="
copy-test-files,
install-gems,
run-junit-interpreted,
run-junit-compiled,
run-junit-embed,
test-rake-targets"
description="Runs unit tests.">
</target>
<target name="test-compiled" depends="copy-test-files,run-junit-compiled,run-junit-precompiled"/>
<target name="test-precompiled" depends="copy-test-files,run-junit-precompiled"/>
<target name="test-interpreted" depends="copy-test-files,run-junit-interpreted"/>
<target name="test-reflected"
depends="copy-test-files,run-junit-reflected-compiled,run-junit-reflected-precompiled,run-junit-reflected-interpreted"/>
<target name="test-threadpool"
depends="copy-test-files,run-junit-compiled-threadpool,run-junit-precompiled-threadpool,run-junit-interpreted-threadpool"/>
<!-- Run tests jitted and with all indy stuff enabled -->
<target name="test-compiled-indy" depends="copy-test-files,run-junit-compiled-indy"/>
<target name="test-all" depends="
copy-test-files,
install-gems,
test-security-manager,
run-junit-interpreted,
run-junit-embed,
run-junit-compiled,
run-junit-precompiled,
run-junit-reflected-precompiled,
run-junit-interpreted-threadpool,
compile-stdlib"
description="Runs unit tests in all modes."/>
<!-- All junit permutations for 1.8 and 1.9 support -->
<target name="run-junit-interpreted">
<run-junit-1.8/>
</target>
<target name="run-junit-reflected-interpreted">
<run-junit-1.8 reflection="true"/>
</target>
<target name="run-junit-compiled">
<run-junit-1.8 compile.mode="JIT" jit.threshold="0"/>
</target>
<target name="run-junit-compiled-indy">
<run-junit-1.8 compile.mode="JIT" jit.threshold="0" jvm.flags="-Djruby.invokedynamic.all=true"/>
</target>
<target name="run-junit-compiled-short">
<run-junit-1.8-short compile.mode="JIT" jit.threshold="0"/>
</target>
<target name="run-junit-interpreted-short">
<run-junit-1.8-short/>
</target>
<target name="run-junit-interpreted-short-debug">
<run-junit-1.8-short jvm.flags="-Xdebug -Xrunjdwp:transport=dt_socket,suspend=n,address=5001"/>
</target>
<target name="run-junit-reflected-compiled">
<run-junit-1.8 compile.mode="JIT" jit.threshold="0" reflection="true"/>
</target>
<target name="run-junit-precompiled">
<run-junit-1.8 compile.mode="FORCE" jit.threshold="0"/>
</target>
<target name="run-junit-reflected-precompiled">
<run-junit-1.8 compile.mode="FORCE" jit.threshold="0" reflection="true"/>
</target>
<target name="run-junit-threadpool" depends="run-junit-interpreted-threadpool,run-junit-compiled-threadpool"/>
<target name="run-junit-interpreted-threadpool">
<run-junit-1.8 thread.pooling="true"/>
</target>
<target name="run-junit-compiled-threadpool">
<run-junit-1.8 compile.mode="JIT" jit.threshold="0" thread.pooling="true"/>
</target>
<target name="run-junit-precompiled-threadpool">
<run-junit-1.8 compile.mode="FORCE" jit.threshold="0" thread.pooling="true"/>
</target>
<target name="run-junit-embed" depends="copy-test-files" description="Runs unit embedding API tests.">
<run-junit-embed-all/>
</target>
<path id="test.class.path">
<pathelement path="${build.lib.dir}/junit.jar"/>
<pathelement path="${build.lib.dir}/livetribe-jsr223-2.0.6.jar"/>
<pathelement path="${build.lib.dir}/bsf.jar"/>
<pathelement path="${build.lib.dir}/commons-logging-1.1.1.jar"/>
<pathelement path="${java.class.path}"/>
<pathelement path="${lib.dir}/jruby.jar"/>
<pathelement location="${test.classes.dir}"/>
<pathelement path="${test.dir}/requireTest.jar"/>
<pathelement location="${test.dir}"/>
</path>
<macrodef name="run-junit">
<attribute name="jruby.version" default="ruby1_8"/>
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="jit.maxsize" default="20"/>
<attribute name="jit.max" default="-1"/>
<attribute name="objectspace.enabled" default="false"/>
<attribute name="thread.pooling" default="false"/>
<attribute name="reflection" default="false"/>
<attribute name="jvm.flags" default=""/>
<element name="junit-tests"/>
<sequential>
<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">
<env key="RUBYOPT" value=""/>
<env key="JRUBY_OPTS" value=""/>
<classpath refid="test.class.path"/>
<sysproperty key="java.awt.headless" value="true"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<sysproperty key="jruby.lib" value="${lib.dir}"/>
<sysproperty key="jruby.compile.mode" value="@{compile.mode}"/>
<sysproperty key="jruby.jit.threshold" value="@{jit.threshold}"/>
<sysproperty key="jruby.jit.maxsize" value="@{jit.maxsize}"/>
<sysproperty key="jruby.jit.max" value="@{jit.max}"/>
<sysproperty key="jruby.compat.version" value="@{jruby.version}"/>
<sysproperty key="jruby.objectspace.enabled" value="@{objectspace.enabled}"/>
<sysproperty key="jruby.thread.pool.enabled" value="@{thread.pooling}"/>
<sysproperty key="jruby.reflection" value="@{reflection}"/>
<sysproperty key="jruby.jit.logging.verbose" value="true"/>
<sysproperty key="jruby.compile.lazyHandles" value="true"/>
<!-- emma coverage tool properties -->
<sysproperty key="emma.coverage.out.file" value="${test.results.dir}/coverage.emma"/>
<sysproperty key="emma.coverage.out.merge" value="true"/>
<sysproperty key="emma.verbosity.level" value="silent"/>
<syspropertyset refid="test.sysproperties"/>
<!-- force client VM to improve test run times AND -->
<!-- set a larger max permgen, since the tests load a lot of bytecode -->
<jvmarg line="-ea ${java.opts} -client -XX:MaxPermSize=${jruby.test.memory.permgen}"/>
<!-- additional flags -->
<jvmarg line="@{jvm.flags}"/>
<formatter type="xml"/>
<formatter type="brief" usefile="false"/>
<junit-tests/>
</junit>
<junitreport todir="${test.results.dir}">
<fileset dir="${test.results.dir}" includes="TEST-*.xml"/>
<report format="frames" todir="${html.test.results.dir}"/>
</junitreport>
</sequential>
</macrodef>
<!-- runs junit tests for 1.8 functionality -->
<macrodef name="run-junit-1.8-short">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="jit.maxsize" default="1000000000"/>
<attribute name="reflection" default="false"/>
<attribute name="thread.pooling" default="false"/>
<attribute name="jvm.flags" default=""/>
<sequential>
<run-junit compile.mode="@{compile.mode}" jit.threshold="@{jit.threshold}"
reflection="@{reflection}" thread.pooling="@{thread.pooling}"
jit.maxsize="@{jit.maxsize}" jvm.flags="@{jvm.flags}">
<junit-tests>
<test name="${test}" if="test"/>
<test name="org.jruby.test.JRubyTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.MRITestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.MainTestSuite" todir="${test.results.dir}" unless="test"/>
</junit-tests>
</run-junit>
</sequential>
</macrodef>
<!-- runs junit tests for 1.8 functionality -->
<macrodef name="run-junit-1.8">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="jit.maxsize" default="1000000000"/>
<attribute name="reflection" default="false"/>
<attribute name="thread.pooling" default="false"/>
<attribute name="objectspace.enabled" default="true"/>
<attribute name="jvm.flags" default=""/>
<sequential>
<run-junit compile.mode="@{compile.mode}" jit.threshold="@{jit.threshold}"
reflection="@{reflection}" thread.pooling="@{thread.pooling}"
jit.maxsize="@{jit.maxsize}" objectspace.enabled="@{objectspace.enabled}"
jvm.flags="@{jvm.flags}">
<junit-tests>
<test name="${test}" if="test"/>
<test name="org.jruby.test.JRubyTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.SlowTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.MRITestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.RubiconTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.ObjectSpaceTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.MainTestSuite" todir="${test.results.dir}" unless="test"/>
</junit-tests>
</run-junit>
</sequential>
</macrodef>
<macrodef name="run-junit-embed-all">
<sequential>
<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">
<classpath refid="test.class.path"/>
<syspropertyset refid="test.sysproperties"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<formatter type="xml"/>
<formatter type="brief" usefile="false"/>
<batchtest fork="yes" todir="${test.results.dir}">
<fileset dir="${test.dir}">
<include name="org/jruby/embed/**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</sequential>
</macrodef>
<macrodef name="test-security-manager-in">
<attribute name="compat.mode" default="--1.8"/>
<sequential>
<java classname="org.jruby.Main" fork="true" failonerror="true">
<classpath refid="test.class.path"/>
<sysproperty key="java.security.manager" value=""/>
<!-- Note the extra '=' in the value, it *is* intentional -->
<sysproperty key="java.security.policy" value="=file:test/restricted.policy"/>
<sysproperty key="java.awt.headless" value="true"/>
<jvmarg line="${java.opts}"/>
<arg line="@{compat.mode}"/>
<arg line="-ve"/>
<arg value="puts 'Restricted policy looks ok'"/>
</java>
</sequential>
</macrodef>
<target name="test-security-manager" depends="jar-jruby, -test-security-18, -test-security-19"/>
<target name="-test-security-18">
<test-security-manager-in compat.mode="--1.8"/>
</target>
<target name="-test-security-19">
<test-security-manager-in compat.mode="--1.9"/>
</target>
<target name="test-rake-targets" depends="init">
<rake task="test:rake_targets" objectspace.enabled="false"/>
</target>
<target name="test-jar-complete" depends="init,unzip-native-libs,jar-jruby-complete"
description="Do some sanity checks on the complete jar.">
<java jar="lib/jruby-complete.jar" fork="true" failonerror="true">
<arg line="-v test/test_jar_complete.rb"/>
</java>
</target>
<target name="test-rails-stable" depends="jar">
<rake task="test:rails"/>
</target>
<target name="test-prawn" depends="jar">
<rake task="test:prawn"/>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.