aboutsummaryrefslogtreecommitdiff
path: root/buildScripts/tests.ant.xml
diff options
context:
space:
mode:
Diffstat (limited to 'buildScripts/tests.ant.xml')
-rw-r--r--buildScripts/tests.ant.xml110
1 files changed, 75 insertions, 35 deletions
diff --git a/buildScripts/tests.ant.xml b/buildScripts/tests.ant.xml
index 41bfa391..9d9e9541 100644
--- a/buildScripts/tests.ant.xml
+++ b/buildScripts/tests.ant.xml
@@ -1,5 +1,5 @@
<!--
- Copyright (C) 2020 The Project Lombok Authors.
+ Copyright (C) 2020-2021 The Project Lombok Authors.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -24,6 +24,14 @@
This buildfile is part of projectlombok.org. It takes care of compiling and running tests.
</description>
+ <target name="test.formatter.compile" depends="deps">
+ <mkdir dir="build/ant" />
+ <ivy:compile ecj="true" srcdir="src/ant" includes="**/SimpleTestFormatter.java" destdir="build/ant" source="1.6" target="1.6">
+ <classpath refid="cp.build" />
+ <classpath refid="cp.test" />
+ </ivy:compile>
+ </target>
+
<target name="test.compile" depends="deps, compile" description="compiles the tests" unless="skip.tests">
<mkdir dir="build/tests" />
<ivy:compile destdir="build/teststubs" source="1.6" target="1.6" ecj="true" nowarn="true">
@@ -33,6 +41,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn
<bootclasspath path="${jdk6-rt.loc}" />
<classpath refid="cp.test" />
<classpath refid="cp.eclipse-oxygen" />
+ <classpath refid="cp.javac6" />
<classpath refid="packing.basedirs.path" />
<classpath path="build/tests" />
<src path="test/core/src" />
@@ -46,7 +55,7 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn
</ivy:compile>
</target>
- <target name="test.ecj11" depends="deps, dist" description="Runs a few ecj-specific tests" unless="skip.tests">
+ <target name="test.ecj11.call" depends="deps, dist" description="Runs a few ecj-specific tests" unless="skip.tests">
<java jar="lib/ecj11/org.eclipse.jdt-ecj.jar" fork="true" failonerror="true">
<jvmarg value="-javaagent:dist/lombok.jar=ecj" />
<arg line="-source 1.6 -target 1.6 -cp dist/lombok.jar test/ecj/SimpleTest.java" />
@@ -54,54 +63,42 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn
<echo>run ecj11 with a test file to confirm agent injection works: OK</echo>
</target>
- <property name="test.addopens.raw">
- --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
- --add-opens jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
- --add-opens jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
- --add-opens jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
- --add-opens jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
- --add-opens jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
- --add-opens jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
- --add-opens jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
- </property>
<property name="test.limitmodules">--limit-modules java.base,jdk.unsupported</property>
- <loadresource property="test.addopens">
- <propertyresource name="test.addopens.raw" />
- <filterchain><tokenfilter>
- <filetokenizer />
- <replaceregex pattern="\s+" replace=" " flags="g" />
- </tokenfilter></filterchain>
- </loadresource>
-
- <target name="test.javac6" depends="test.compile" description="runs the tests on your default VM, using javac6 as underlying compiler">
+ <target name="test.javac6" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, using javac6 as underlying compiler">
<echo>Running TestJavac on JVM${ant.java.version}, with lowest supported javac: 1.6.</echo>
<junit haltonfailure="yes" fork="true" forkmode="once">
+ <formatter classname="lombok.ant.SimpleTestFormatter" usefile="false" unless="tests.quiet" />
+ <classpath location="build/ant" />
<jvmarg value="-Xbootclasspath/a:${jdk6-rt.loc}" />
<jvmarg line="${test.limitmodules}" />
<jvmarg value="-Ddelombok.bootclasspath=${jdk6-rt.loc}" />
- <formatter type="plain" usefile="false" unless="tests.quiet" />
+ <jvmarg value="-Dsun.boot.class.path=${jdk6-rt.loc}" />
<classpath refid="cp.test" />
<classpath refid="cp.stripe" />
<classpath refid="cp.javac6" />
<classpath refid="packing.basedirs.path" />
<classpath location="build/tests" />
+ <classpath location="build/teststubs" />
<test name="lombok.TestJavac" />
</junit>
</target>
- <target name="test.javac8" depends="test.compile, deps.jdk8-runtime" description="runs the tests on your default VM, using javac8 as underlying compiler">
+ <target name="test.javac8" depends="test.formatter.compile, test.compile, deps.jdk8-runtime" description="runs the tests on your default VM, using javac8 as underlying compiler">
<echo>Running TestJavac on JVM${ant.java.version}, with javac: 1.8.</echo>
<junit haltonfailure="yes" fork="true" forkmode="once">
+ <formatter classname="lombok.ant.SimpleTestFormatter" usefile="false" unless="tests.quiet" />
<jvmarg value="-Xbootclasspath/a:${jdk8-rt.loc}" />
<jvmarg line="${test.limitmodules}" />
<jvmarg value="-Ddelombok.bootclasspath=${jdk8-rt.loc}" />
- <formatter type="plain" usefile="false" unless="tests.quiet" />
+ <jvmarg value="-Dsun.boot.class.path=${jdk8-rt.loc}" />
+ <classpath location="build/ant" />
<classpath refid="cp.test" />
<classpath refid="cp.stripe" />
<classpath refid="cp.javac8" />
<classpath refid="packing.basedirs.path" />
<classpath location="build/tests" />
+ <classpath location="build/teststubs" />
<test name="lombok.TestJavac" />
</junit>
</target>
@@ -113,8 +110,8 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn
<echo>Running TestJavac with JVM ${jvm.loc.@{version}}.</echo>
<junit haltonfailure="yes" fork="true" forkmode="once" jvm="${jvm.loc.@{version}}/bin/${exe.java}">
- <jvmarg line="${test.addopens}" />
- <formatter type="plain" usefile="false" unless="tests.quiet" />
+ <formatter classname="lombok.ant.SimpleTestFormatter" usefile="false" unless="tests.quiet" />
+ <classpath location="build/ant" />
<classpath refid="cp.test" />
<classpath refid="cp.stripe" />
<classpath refid="packing.basedirs.path" />
@@ -125,19 +122,25 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn
</sequential>
</macrodef>
- <target name="test.javac11" depends="test.compile" description="runs the tests on your default VM, using javac11 as underlying compiler">
+ <target name="test.javac11" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, using javac11 as underlying compiler">
<test.javacX version="11" />
</target>
- <target name="test.javac14" depends="test.compile" description="runs the tests on your default VM, using javac14 as underlying compiler">
+ <!-- For non-LTS versions, feel free to aggressively update these to the current non-LTS openjdk version, and delete them once they roll out of the 6month window. -->
+
+ <target name="test.javac14" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, using javac14 as underlying compiler">
<test.javacX version="14" />
</target>
- <target name="test.javacCurrent" depends="test.compile" description="runs the tests on your default VM, using its javac as underlying compiler">
+ <target name="test.javac16" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, using javac16 as underlying compiler">
+ <test.javacX version="16" />
+ </target>
+
+ <target name="test.javacCurrent" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, using its javac as underlying compiler">
<echo>Running TestJavac on JVM${ant.java.version}, with the javac built into your VM distributon.</echo>
<junit haltonfailure="yes" fork="true" forkmode="once">
- <jvmarg line="${test.addopens}" />
- <formatter type="plain" usefile="false" unless="tests.quiet" />
+ <formatter classname="lombok.ant.SimpleTestFormatter" usefile="false" unless="tests.quiet" />
+ <classpath location="build/ant" />
<classpath refid="cp.test" />
<classpath refid="cp.stripe" />
<classpath refid="packing.basedirs.path" />
@@ -152,30 +155,67 @@ This buildfile is part of projectlombok.org. It takes care of compiling and runn
<sequential>
<echo>Running TestEclipse on eclipse-@{version} on JVM${ant.java.version}.</echo>
<junit haltonfailure="yes" fork="true" forkmode="once">
+ <formatter classname="lombok.ant.SimpleTestFormatter" usefile="false" unless="tests.quiet" />
<jvmarg value="-Xbootclasspath/a:${jdk8-rt.loc}" />
<jvmarg value="-Ddelombok.bootclasspath=${jdk8-rt.loc}" />
<jvmarg value="-javaagent:dist/lombok.jar" />
- <jvmarg line="${test.addopens}" />
- <formatter type="plain" usefile="false" unless="tests.quiet" />
+ <classpath location="build/ant" />
<classpath refid="cp.test" />
<classpath refid="cp.stripe" />
<classpath refid="cp.eclipse-@{version}" />
<classpath refid="packing.basedirs.path" />
<classpath location="build/tests" />
+ <classpath location="build/teststubs" />
<test name="lombok.TestEclipse" />
</junit>
</sequential>
</macrodef>
- <target name="test.eclipse-oxygen" depends="test.compile" description="runs the tests on your default VM, testing the oxygen release of eclipse">
+ <target name="test.eclipse-oxygen" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, testing the oxygen release of eclipse">
<test.eclipse-X version="oxygen" />
</target>
- <target name="test.eclipse-202006" depends="test.compile" description="runs the tests on your default VM, testing the 2020-03 release of eclipse">
+ <target name="test.eclipse-202006" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, testing the 2020-03 release of eclipse">
<fetchdep.eclipse version="202006" />
<test.eclipse-X version="202006" />
</target>
+ <macrodef name="test.ecj-X">
+ <attribute name="version" />
+ <sequential>
+ <echo>Running TestEclipse on ecj-@{version} on JVM${ant.java.version}.</echo>
+ <junit haltonfailure="yes" fork="true" forkmode="once">
+ <formatter classname="lombok.ant.SimpleTestFormatter" usefile="false" unless="tests.quiet" />
+ <jvmarg value="-Xbootclasspath/a:${jdk8-rt.loc}" />
+ <jvmarg value="-Ddelombok.bootclasspath=${jdk8-rt.loc}" />
+ <jvmarg value="-javaagent:dist/lombok.jar" />
+ <classpath location="build/ant" />
+ <classpath refid="cp.test" />
+ <classpath refid="cp.stripe" />
+ <classpath refid="cp.ecj@{version}" />
+ <classpath refid="packing.basedirs.path" />
+ <classpath location="build/tests" />
+ <classpath location="build/teststubs" />
+ <test name="lombok.TestEclipse" />
+ </junit>
+ </sequential>
+ </macrodef>
+
+ <target name="test.ecj11" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, testing the ecj11 release">
+ <fetchdep.ecj version="11" />
+ <test.ecj-X version="11" />
+ </target>
+
+ <target name="test.ecj14" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, testing the ecj11 release">
+ <fetchdep.ecj version="14" />
+ <test.ecj-X version="14" />
+ </target>
+
+ <target name="test.ecj16" depends="test.formatter.compile, test.compile" description="runs the tests on your default VM, testing the ecj11 release">
+ <fetchdep.ecj version="16" />
+ <test.ecj-X version="16" />
+ </target>
+
<target name="test" depends="test.javacCurrent, test.eclipse-202006" description="runs the tests against the default JVM, javac, and eclipse" />
<target name="test.broad" depends="test.javac8, test.javac14, test.eclipse-oxygen, test.eclipse-202006" description="runs the tests against the default JVM, javac, and eclipse" />
</project>