Usually when writing tests in a Gradle project I add something like this to the build file so I can get an overview of how many tests passed/failed/etc.:
allTests is an aggregating task of type KotlinTestReport that extends Gradle’s TestReport task and generates a summarized test report for all platforms after separate test tasks for each target platform have run. It’s not a test task, so you can’t configure it as you used to configure single platform tests. You can however configure each of the latter test tasks using tasks.withType function:
Hi @ilya.gorbunov, I’m trying to log these results but I can’t seem to make this work, where do I need to add the tasks.withType(AbstractTestTask) { ... } code?
Anywhere at the top-level of a gradle build script.
Note that I gave this example in the Groovy script syntax (the same as in the question). With the Kotlin script, it would be something like tasks.withType<AbstractTestTask> { ... }
I tried that already yesterday but that didn’t work @ilya.gorbunov. When I run the multiplatform tests for all targets using ./gradlew check no results are logged on the console for the tests. Do I need to add something else apart from this?