Skip to content

Commit 29e726f

Browse files
committed
Disabled Kotlin codegen tests with static mocks
1 parent a53d179 commit 29e726f

File tree

4 files changed

+43
-5
lines changed

4 files changed

+43
-5
lines changed

utbot-framework-test/src/test/kotlin/org/utbot/examples/algorithms/SortTest.kt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,20 @@ import org.utbot.framework.plugin.api.DocPreTagStatement
99
import org.utbot.framework.plugin.api.DocRegularStmt
1010
import org.utbot.framework.plugin.api.MockStrategyApi
1111
import org.junit.jupiter.api.Test
12+
import org.utbot.framework.plugin.api.CodegenLanguage
1213
import org.utbot.testcheckers.eq
1314
import org.utbot.testcheckers.ge
14-
15-
internal class SortTest : UtValueTestCaseChecker(testClass = Sort::class) {
15+
import org.utbot.tests.infrastructure.CodeGeneration
16+
17+
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
18+
internal class SortTest : UtValueTestCaseChecker(
19+
testClass = Sort::class,
20+
testCodeGeneration = true,
21+
languagePipelines = listOf(
22+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
23+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
24+
)
25+
) {
1626
@Test
1727
fun testQuickSort() {
1828
check(

utbot-framework-test/src/test/kotlin/org/utbot/examples/mock/MockRandomTest.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,15 @@ import java.util.Random
1313
import org.junit.jupiter.api.Test
1414
import org.utbot.testcheckers.eq
1515

16-
internal class MockRandomTest : UtValueTestCaseChecker(testClass = MockRandomExamples::class) {
16+
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
17+
internal class MockRandomTest : UtValueTestCaseChecker(
18+
testClass = MockRandomExamples::class,
19+
testCodeGeneration = true,
20+
languagePipelines = listOf(
21+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
22+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
23+
)
24+
) {
1725
@Test
1826
fun testRandomAsParameter() {
1927
val method: Random.() -> Int = Random::nextInt

utbot-framework-test/src/test/kotlin/org/utbot/examples/natives/NativeExamplesTest.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,21 @@ package org.utbot.examples.natives
33
import org.utbot.tests.infrastructure.UtValueTestCaseChecker
44
import org.utbot.tests.infrastructure.DoNotCalculate
55
import org.junit.jupiter.api.Test
6+
import org.utbot.framework.plugin.api.CodegenLanguage
67
import org.utbot.testcheckers.eq
78
import org.utbot.testcheckers.ge
89
import org.utbot.testcheckers.withSolverTimeoutInMillis
10+
import org.utbot.tests.infrastructure.CodeGeneration
911

10-
internal class NativeExamplesTest : UtValueTestCaseChecker(testClass = NativeExamples::class) {
12+
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
13+
internal class NativeExamplesTest : UtValueTestCaseChecker(
14+
testClass = NativeExamples::class,
15+
testCodeGeneration = true,
16+
languagePipelines = listOf(
17+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
18+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
19+
)
20+
) {
1121

1222
@Test
1323
fun testFindAndPrintSum() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/recursion/RecursionTest.kt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,20 @@ import org.utbot.framework.plugin.api.DocStatement
1313
import kotlin.math.pow
1414
import org.junit.jupiter.api.Disabled
1515
import org.junit.jupiter.api.Test
16+
import org.utbot.framework.plugin.api.CodegenLanguage
1617
import org.utbot.testcheckers.eq
1718
import org.utbot.testcheckers.ge
19+
import org.utbot.tests.infrastructure.CodeGeneration
1820

19-
internal class RecursionTest : UtValueTestCaseChecker(testClass = Recursion::class) {
21+
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
22+
internal class RecursionTest : UtValueTestCaseChecker(
23+
testClass = Recursion::class,
24+
testCodeGeneration = true,
25+
languagePipelines = listOf(
26+
CodeGenerationLanguageLastStage(CodegenLanguage.JAVA),
27+
CodeGenerationLanguageLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
28+
)
29+
) {
2030
@Test
2131
fun testFactorial() {
2232
val factorialSummary = listOf<DocStatement>(

0 commit comments

Comments
 (0)