@@ -3,7 +3,6 @@ package org.utbot.framework.codegen.model.constructor.tree
33import org.utbot.common.appendHtmlLine
44import org.utbot.framework.codegen.model.constructor.CgMethodTestSet
55import org.utbot.framework.codegen.model.tree.CgTestMethod
6- import org.utbot.framework.codegen.model.tree.CgTestMethodType
76import org.utbot.framework.codegen.model.tree.CgTestMethodType.*
87import org.utbot.framework.plugin.api.ExecutableId
98import org.utbot.framework.plugin.api.util.kClass
@@ -35,15 +34,15 @@ data class TestsGenerationReport(
3534 val errors = executables.map { it.countErrors() }
3635 val overallErrors = errors.sum()
3736
38- appendHtmlLine(" Successful test methods: ${testMethodsStatistic.sumBy { it.successful }} " )
37+ appendHtmlLine(" Successful test methods: ${testMethodsStatistic.sumOf { it.successful }} " )
3938 appendHtmlLine(
40- " Failing because of unexpected exception test methods: ${testMethodsStatistic.sumBy { it.failing }} "
39+ " Failing because of unexpected exception test methods: ${testMethodsStatistic.sumOf { it.failing }} "
4140 )
4241 appendHtmlLine(
43- " Failing because of exceeding timeout test methods: ${testMethodsStatistic.sumBy { it.timeout }} "
42+ " Failing because of exceeding timeout test methods: ${testMethodsStatistic.sumOf { it.timeout }} "
4443 )
4544 appendHtmlLine(
46- " Failing because of possible JVM crash test methods: ${testMethodsStatistic.sumBy { it.crashes }} "
45+ " Failing because of possible JVM crash test methods: ${testMethodsStatistic.sumOf { it.crashes }} "
4746 )
4847 appendHtmlLine(" Not generated because of internal errors test methods: $overallErrors " )
4948 }
@@ -71,17 +70,16 @@ data class TestsGenerationReport(
7170 }
7271 }
7372
73+ fun countTestMethods () = executables.map { it.countTestMethods() }.sumOf { it.count }
74+
7475 fun toString (isShort : Boolean ): String = buildString {
7576 appendHtmlLine(" Target: ${classUnderTest.qualifiedName} " )
7677 if (initialWarnings.isNotEmpty()) {
7778 initialWarnings.forEach { appendHtmlLine(it()) }
7879 appendHtmlLine()
7980 }
8081
81- val testMethodsStatistic = executables.map { it.countTestMethods() }
82- val overallTestMethods = testMethodsStatistic.sumBy { it.count }
83-
84- appendHtmlLine(" Overall test methods: $overallTestMethods " )
82+ appendHtmlLine(" Overall test methods: ${countTestMethods()} " )
8583
8684 if (! isShort) {
8785 appendHtmlLine(detailedStatistics)
0 commit comments