@@ -3,7 +3,6 @@ package org.utbot.framework.codegen.model.constructor.tree
3
3
import org.utbot.common.appendHtmlLine
4
4
import org.utbot.framework.codegen.model.constructor.CgMethodTestSet
5
5
import org.utbot.framework.codegen.model.tree.CgTestMethod
6
- import org.utbot.framework.codegen.model.tree.CgTestMethodType
7
6
import org.utbot.framework.codegen.model.tree.CgTestMethodType.*
8
7
import org.utbot.framework.plugin.api.ExecutableId
9
8
import org.utbot.framework.plugin.api.util.kClass
@@ -35,15 +34,15 @@ data class TestsGenerationReport(
35
34
val errors = executables.map { it.countErrors() }
36
35
val overallErrors = errors.sum()
37
36
38
- appendHtmlLine(" Successful test methods: ${testMethodsStatistic.sumBy { it.successful }} " )
37
+ appendHtmlLine(" Successful test methods: ${testMethodsStatistic.sumOf { it.successful }} " )
39
38
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 }} "
41
40
)
42
41
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 }} "
44
43
)
45
44
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 }} "
47
46
)
48
47
appendHtmlLine(" Not generated because of internal errors test methods: $overallErrors " )
49
48
}
@@ -71,17 +70,16 @@ data class TestsGenerationReport(
71
70
}
72
71
}
73
72
73
+ fun countTestMethods () = executables.map { it.countTestMethods() }.sumOf { it.count }
74
+
74
75
fun toString (isShort : Boolean ): String = buildString {
75
76
appendHtmlLine(" Target: ${classUnderTest.qualifiedName} " )
76
77
if (initialWarnings.isNotEmpty()) {
77
78
initialWarnings.forEach { appendHtmlLine(it()) }
78
79
appendHtmlLine()
79
80
}
80
81
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()} " )
85
83
86
84
if (! isShort) {
87
85
appendHtmlLine(detailedStatistics)
0 commit comments