Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import org.jetbrains.changelog.Changelog
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
import org.gradle.api.tasks.testing.TestDescriptor
import org.gradle.api.tasks.testing.TestResult
import org.gradle.kotlin.dsl.KotlinClosure2

plugins {
id("java") // Java support
Expand Down Expand Up @@ -172,12 +175,44 @@ tasks {
)
testLogging {
// Exclude standardError, standardOut
events("skipped", "failed")
val showPassed = providers.gradleProperty("showPassed").isPresent
if (!showPassed) {
println(
"""
ℹ️ Passed test output is hidden.
Re-run with -PshowPassed to include PASSED tests in the output.
""".trimIndent()
)
}

events(
"failed",
"skipped",
*if (showPassed) arrayOf("passed") else emptyArray() // Use''-PshowPassed' option to see PASSED tests in output
)

exceptionFormat = org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true
}
afterSuite(
KotlinClosure2<TestDescriptor, TestResult, Unit>({ desc, result ->
if (desc.parent == null) {
println(
"""
===============================
Test summary:
Total: ${result.testCount}
Passed: ${result.successfulTestCount}
Failed: ${result.failedTestCount}
Skipped: ${result.skippedTestCount}
===============================
""".trimIndent()
)
}
})
)
}
}

Expand Down
Loading