mirror of
https://github.com/google/nomulus.git
synced 2025-07-21 18:26:12 +02:00
Add a "showErrorOutput" property (#237)
* Add a "showErrorOutput" property Add a property to let us dump test output and final status in real-time to the console.
This commit is contained in:
parent
6dee3d526e
commit
69cb852a9c
2 changed files with 33 additions and 0 deletions
32
build.gradle
32
build.gradle
|
@ -12,6 +12,9 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||
|
||||
buildscript {
|
||||
if (rootProject.enableDependencyLocking.toBoolean()) {
|
||||
// Lock buildscript dependencies.
|
||||
|
@ -256,6 +259,35 @@ subprojects {
|
|||
}
|
||||
}
|
||||
|
||||
// If "-P verboseTestOutput=true" is passed in, configure all subprojects to dump all of their
|
||||
// output and final test status (pass/fail, errors) for each test class.
|
||||
//
|
||||
// Note that we can't do this in the main subprojects section above because that's evaluated before
|
||||
// the subproject build files and the test tasks haven't been defined yet. We have to do it from
|
||||
// the projectsEvaluted hook, which gets called after the subprojects are configured.
|
||||
if (verboseTestOutput.toBoolean()) {
|
||||
gradle.projectsEvaluated({
|
||||
subprojects {
|
||||
tasks.withType(Test) {
|
||||
testLogging {
|
||||
events TestLogEvent.FAILED, TestLogEvent.PASSED, TestLogEvent.SKIPPED,
|
||||
TestLogEvent.STANDARD_OUT, TestLogEvent.STANDARD_ERROR
|
||||
exceptionFormat TestExceptionFormat.FULL
|
||||
showExceptions true
|
||||
showCauses true
|
||||
showStackTraces true
|
||||
|
||||
afterSuite { desc, result ->
|
||||
println "Results: ${result.resultType}, " +
|
||||
"${result.successfulTestCount}/${result.testCount} tests " +
|
||||
"passed, ${result.failedTestCount} failures.";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
task checkDependenciesDotGradle {
|
||||
def buildSrcDepsFile = File.createTempFile('buildSrc', 'deps')
|
||||
buildSrcDepsFile.deleteOnExit()
|
||||
|
|
|
@ -3,5 +3,6 @@ pluginsUrl=
|
|||
uploaderDestination=
|
||||
uploaderCredentialsFile=
|
||||
uploaderMultithreadedUpload=
|
||||
verboseTestOutput=false
|
||||
flowDocsFile=
|
||||
enableDependencyLocking=true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue