mirror of
https://github.com/google/nomulus
synced 2026-01-03 19:54:18 +00: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:
32
build.gradle
32
build.gradle
@@ -12,6 +12,9 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
|
|
||||||
|
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
|
||||||
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
if (rootProject.enableDependencyLocking.toBoolean()) {
|
if (rootProject.enableDependencyLocking.toBoolean()) {
|
||||||
// Lock buildscript dependencies.
|
// 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 {
|
task checkDependenciesDotGradle {
|
||||||
def buildSrcDepsFile = File.createTempFile('buildSrc', 'deps')
|
def buildSrcDepsFile = File.createTempFile('buildSrc', 'deps')
|
||||||
buildSrcDepsFile.deleteOnExit()
|
buildSrcDepsFile.deleteOnExit()
|
||||||
|
|||||||
@@ -3,5 +3,6 @@ pluginsUrl=
|
|||||||
uploaderDestination=
|
uploaderDestination=
|
||||||
uploaderCredentialsFile=
|
uploaderCredentialsFile=
|
||||||
uploaderMultithreadedUpload=
|
uploaderMultithreadedUpload=
|
||||||
|
verboseTestOutput=false
|
||||||
flowDocsFile=
|
flowDocsFile=
|
||||||
enableDependencyLocking=true
|
enableDependencyLocking=true
|
||||||
|
|||||||
Reference in New Issue
Block a user