This is an automated email from the ASF dual-hosted git repository.
csutherl pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 09ba860efe Add option to silence all junit test output and rely on
summary outputs for test status (#926)
09ba860efe is described below
commit 09ba860efe95b25e9f4e7b20bd1f2733d4ec8a31
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 6f767f4ab6..539543c3cf 100644
--- a/BUILDING.txt
+++ b/BUILDING.txt
@@ -538,7 +538,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 b7c49fcba1..254cbc8d0f 100644
--- a/build.properties.default
+++ b/build.properties.default
@@ -78,6 +78,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 b310763316..68e7991cb4 100644
--- a/build.xml
+++ b/build.xml
@@ -1918,6 +1918,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.
@@ -2143,7 +2151,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 f8689fa320..f7a45d9093 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 9.0.113 (remm)" 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]