You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2018/04/10 16:01:01 UTC
svn commit: r1828829 - /openoffice/trunk/main/solenv/ant/aoo-ant.xml
Author: damjan
Date: Tue Apr 10 16:01:01 2018
New Revision: 1828829
URL: http://svn.apache.org/viewvc?rev=1828829&view=rev
Log:
Check whether JUnit tests are present before trying to compile them.
Patch by: me
Modified:
openoffice/trunk/main/solenv/ant/aoo-ant.xml
Modified: openoffice/trunk/main/solenv/ant/aoo-ant.xml
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/solenv/ant/aoo-ant.xml?rev=1828829&r1=1828828&r2=1828829&view=diff
==============================================================================
--- openoffice/trunk/main/solenv/ant/aoo-ant.xml (original)
+++ openoffice/trunk/main/solenv/ant/aoo-ant.xml Tue Apr 10 16:01:01 2018
@@ -118,11 +118,30 @@
includeantruntime="false"/>
</target>
- <target name="test-compile" depends="compile,idl">
- <property name="test.skip" value="true" unless:set="OOO_JUNIT_JAR"/>
- <echo message="No junit, skipping tests" unless:set="OOO_JUNIT_JAR"/>
+ <target name="test-check">
+ <local name="tests.present"/>
+ <available type="dir" file="${test.src.dir}" property="tests.present"/>
+ <echo message="No tests" unless:set="tests.present"/>
- <mkdir dir="${test.build.dir}" if:set="OOO_JUNIT_JAR"/>
+ <local name="only.junit.absent"/>
+ <condition property="only.junit.absent">
+ <and>
+ <isset property="tests.present"/>
+ <not><isset property="OOO_JUNIT_JAR"/></not>
+ </and>
+ </condition>
+ <echo message="No junit, skipping tests" if:set="only.junit.absent"/>
+
+ <condition property="test.skip">
+ <or>
+ <not><isset property="test.present"/></not>
+ <not><isset property="OOO_JUNIT_JAR"/></not>
+ </or>
+ </condition>
+ </target>
+
+ <target name="test-compile" depends="compile,idl,test-check">
+ <mkdir dir="${test.build.dir}" unless:set="test.skip"/>
<javac srcdir="${test.src.dir}"
destdir="${test.build.dir}"
debug="${test.debug}"
@@ -130,7 +149,7 @@
deprecation="${test.deprecation}"
classpathref="internal.test.classpath"
includeantruntime="false"
- if:set="OOO_JUNIT_JAR"/>
+ unless:set="test.skip"/>
</target>
<!-- fork="true" is sadly necessary on Ubuntu due to multiple versions of junit confusing Ant,