Created
October 13, 2016 14:00
-
-
Save cesarferreira/98c5a4c16d39eb2a97a4f8c1e12c843b to your computer and use it in GitHub Desktop.
Pretty print for android error logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| task testLogDecorator { | |
| tasks.withType(Test) { | |
| testLogging { | |
| events "passed", "skipped", "failed", "standardOut" | |
| showExceptions true | |
| exceptionFormat "full" | |
| showCauses true | |
| showStackTraces true | |
| debug { | |
| events "started", "passed", "skipped", "failed", "standardOut", "standardError" | |
| exceptionFormat "full" | |
| } | |
| afterSuite { desc, result -> | |
| if (!desc.parent) { | |
| def output = "$project.name test result: [TESTS: ${result.testCount}, PASSED: ${result.successfulTestCount}, FAILED: ${result.failedTestCount}, SKIPPED: ${result.skippedTestCount}]" | |
| def startItem = '### ', endItem = ' ###' | |
| def repeatLength = startItem.length() + output.length() + endItem.length() | |
| println('\n' + ('#' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('#' * repeatLength)) | |
| } | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment