This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 9f358616b7 Add targets allowing running the testsuite with the minimum 
Java version
9f358616b7 is described below

commit 9f358616b75bc9da854e4f29b215b106d18dd077
Author: remm <r...@apache.org>
AuthorDate: Thu Jun 20 11:12:37 2024 +0200

    Add targets allowing running the testsuite with the minimum Java version
    
    From Rainer.
---
 build.xml                  | 25 ++++++++++++++++++++++---
 webapps/docs/changelog.xml |  9 +++++++++
 2 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/build.xml b/build.xml
index 39af943513..fe5f54cccf 100644
--- a/build.xml
+++ b/build.xml
@@ -110,11 +110,15 @@
   <property name="min.java.version" value="17"/>
   <property name="build.java.version" value="17"/>
   <property name="release.java.version" value="22"/>
+  <property name="skip.build.java.version" value="false"/>
 
   <!-- Check Java Build Version -->
   <fail message="Java version ${build.java.version} or newer is required 
(${java.version} is installed)">
     <condition>
-      <not><javaversion atleast="${build.java.version}" /></not>
+      <and>
+        <not><javaversion atleast="${build.java.version}"/></not>
+        <not><istrue value="${skip.build.java.version}"/></not>
+      </and>
     </condition>
   </fail>
 
@@ -1930,6 +1934,9 @@
   <target name="test" description="Runs the JUnit test cases"
           depends="test-nio,test-nio2,coverage-report,test-status" />
 
+  <target name="test-only" description="Runs the JUnit test cases, without 
compilation"
+          depends="test-only-nio,test-only-nio2,test-status" />
+
   <target name="test-status"
           description="Analyses logs directory and reports on skipped tests, 
test failures and test errors">
     <fileset id="test.result.skippedtests" dir="${test.reports}" 
includes="*.txt">
@@ -1971,12 +1978,24 @@
               extension=".NIO" />
   </target>
 
+  <target name="test-only-nio" description="Runs the JUnit test cases or NIO 
without test preparations. Does not stop on errors."
+          depends="setup-jacoco,test-openssl-exists" if="${execute.test.nio}">
+    <runtests protocol="org.apache.coyote.http11.Http11Nio2Protocol"
+              extension=".NIO" />
+  </target>
+
   <target name="test-nio2" description="Runs the JUnit test cases for NIO2. 
Does not stop on errors."
           depends="setup-jacoco,test-compile,deploy,test-openssl-exists" 
if="${execute.test.nio2}">
     <runtests protocol="org.apache.coyote.http11.Http11Nio2Protocol"
               extension=".NIO2" />
   </target>
 
+  <target name="test-only-nio2" description="Runs the JUnit test cases or NIO2 
without test preparations. Does not stop on errors."
+          depends="setup-jacoco,test-openssl-exists" if="${execute.test.nio2}">
+    <runtests protocol="org.apache.coyote.http11.Http11Nio2Protocol"
+          extension=".NIO2" />
+  </target>
+
   <target name="test-openssl-exists" description="Checks for the OpenSSL 
binary">
     <property environment="env" />
     <condition property="test.openssl.exists">
@@ -3913,7 +3932,7 @@ Read the Building page on the Apache Tomcat documentation 
site for details on ho
     </antcall>
   </target>
 
-  <target name="setup-bnd" depends="download-bnd">
+  <target name="setup-bnd" depends="download-bnd" 
unless="skip.build.java.version">
     <!-- Add bnd tasks to project -->
     <path id="bnd.classpath">
       <fileset file="${bnd.jar}" />
@@ -3988,7 +4007,7 @@ Read the Building page on the Apache Tomcat documentation 
site for details on ho
     </sequential>
   </macrodef>
 
-  <target name="add-osgi" if="${addOSGi}" >
+  <target name="add-osgi" if="${addOSGi}" unless="skip.build.java.version">
     <echo message="add-osgi ${jarfile} ${addOSGi}"></echo>
     <local name="filename"/>
     <basename property="filename" file="${jarfile}"/>
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 7aac4068e6..12b8eed923 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -128,6 +128,15 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Other">
+    <changelog>
+      <update>
+        Add <code>test-only</code> build target to allow running only the
+        testsuite, supporting Java versions down to the minimum supported
+        to run Tomcat. (rjung)
+      </update>
+    </changelog>
+  </subsection>
 </section>
 <section name="Tomcat 11.0.0-M21 (markt)" rtext="release in progress">
   <subsection name="Catalina">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to