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

csutherl pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/10.1.x by this push:
     new d4eabbe4ce Add option to silence all junit test output and rely on 
summary outputs for test status (#926)
d4eabbe4ce is described below

commit d4eabbe4ce34688d63fa3dcc89a8b6b182149e2b
Author: Coty Sutherland <[email protected]>
AuthorDate: Tue Dec 2 14:49:32 2025 -0500

    Add option to silence all junit test output and rely on summary outputs for 
test status (#926)
---
 BUILDING.txt               | 11 ++++++++++-
 build.properties.default   |  2 ++
 build.xml                  | 10 +++++++++-
 webapps/docs/changelog.xml |  9 +++++++++
 4 files changed, 30 insertions(+), 2 deletions(-)

diff --git a/BUILDING.txt b/BUILDING.txt
index 6ca9e5dada..465ed6b39f 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -539,7 +539,16 @@ as for the property "test.name".
  This is configured by setting "test.threads" property. The recommended
  value is one thread per core.
 
- 6. Optional support is provided for the Cobertura code coverage tool.
+ 6. Test output can be suppressed for cleaner console output, especially useful
+ when running tests with multiple threads:
+
+        ant test -Dtest.silent=true
+
+ This suppresses JUnit console output while still saving all test results to
+ individual log files in output/build/logs. The test-status target will still
+ display a summary of any failures or skipped tests.
+
+ 7. Optional support is provided for the Cobertura code coverage tool.
 
 NOTE: Cobertura is licensed under GPL v2 with parts of it being under
       Apache License v1.1. See https://cobertura.github.io/cobertura/ for 
details.
diff --git a/build.properties.default b/build.properties.default
index 12ff5d73cb..a82bd6f121 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -76,6 +76,8 @@ test.haltonfailure=false
 test.accesslog=false
 # Display the tests output on the console
 test.verbose=true
+# Suppress JUnit console output (useful for parallel testing)
+test.silent=false
 
 # Number of parallel threads to use for testing. The recommended value is one
 # thread per core.
diff --git a/build.xml b/build.xml
index 015e3930e8..1619685e1a 100644
--- a/build.xml
+++ b/build.xml
@@ -1949,6 +1949,14 @@
   <property name="junit.formatter.usefile" value="true" />
   <property name="junit.formatter.extension" value=".txt" />
 
+  <!-- Configure JUnit output based on test.silent property -->
+  <condition property="junit.printsummary" value="off" else="yes">
+    <istrue value="${test.silent}"/>
+  </condition>
+  <condition property="junit.showoutput" value="false" else="${test.verbose}">
+    <istrue value="${test.silent}"/>
+  </condition>
+
   <!-- ==================== Test Profile System ==================== -->
   <!--
     Property-based test profiles for convenient, selective test execution.
@@ -2149,7 +2157,7 @@
           enabled="${test.coverage}"
           destfile="${coverage.datafile}"
           >
-        <junit printsummary="yes" fork="yes" dir="." 
showoutput="${test.verbose}"
+        <junit printsummary="${junit.printsummary}" fork="yes" dir="." 
showoutput="${junit.showoutput}"
           errorproperty="test.result.error"
           failureproperty="test.result.failure"
           haltonfailure="${test.haltonfailure}"
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 95c4626dae..6be7ead854 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,15 @@
   issues do not "pop up" wrt. others).
 -->
 <section name="Tomcat 10.1.50 (schultz)" rtext="in development">
+  <subsection name="General">
+    <changelog>
+      <add>
+        Add <code>test.silent</code> property to suppress JUnit console output
+        during test execution. Useful for cleaner console output when running
+        tests with multiple threads. (csutherl)
+      </add>
+    </changelog>
+  </subsection>
   <subsection name="Catalina">
     <changelog>
       <fix>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to