From a2f7356d5e3682abefd4200db6b07b34d5e6b47d Mon Sep 17 00:00:00 2001 From: Kazik Pogoda Date: Wed, 2 Oct 2024 08:36:13 +0200 Subject: [PATCH] add exception logging in tests run from gradle --- build.gradle.kts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index c5473dc..2d87906 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,6 +1,8 @@ @file:OptIn(ExperimentalKotlinGradlePluginApi::class) import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask +import org.gradle.api.tasks.testing.logging.TestExceptionFormat +import org.gradle.api.tasks.testing.logging.TestLogEvent import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion @@ -111,6 +113,18 @@ tasks.withType { } } +tasks.withType() { + testLogging { + events( + TestLogEvent.PASSED, + TestLogEvent.SKIPPED, + TestLogEvent.FAILED + ) + showStackTraces = true + exceptionFormat = TestExceptionFormat.FULL + } +} + @Suppress("OPT_IN_USAGE") powerAssert { functions = listOf(