Skip to content

Commit 8cfd494

Browse files
Significantly refactor UtBot autotests (#2378)
1 parent f0662a7 commit 8cfd494

File tree

79 files changed

+322
-672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+322
-672
lines changed

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

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
package org.utbot.examples.algorithms
22

3-
import org.utbot.framework.plugin.api.CodegenLanguage
43
import org.junit.jupiter.api.Test
54
import org.utbot.examples.algorithms.CorrectBracketSequences.isBracket
65
import org.utbot.examples.algorithms.CorrectBracketSequences.isOpen
76
import org.utbot.testcheckers.eq
8-
import org.utbot.testing.CodeGeneration
9-
import org.utbot.testing.UtValueTestCaseChecker
10-
import org.utbot.testing.ignoreExecutionsNumber
11-
import org.utbot.testing.isException
7+
import org.utbot.testing.*
128

139
internal class CorrectBracketSequencesTest : UtValueTestCaseChecker(
1410
testClass = CorrectBracketSequences::class,
1511
testCodeGeneration = true,
16-
pipelines = listOf(
17-
TestLastStage(CodegenLanguage.JAVA),
18-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration) // TODO generics in lists
19-
)
12+
configurations = ignoreKotlinCompilationConfigurations,
2013
) {
2114
@Test
2215
fun testIsOpen() {

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,17 @@ package org.utbot.examples.algorithms
22

33
import org.utbot.framework.plugin.api.MockStrategyApi
44
import org.junit.jupiter.api.Test
5+
import org.utbot.framework.codegen.domain.ParametrizedTestSource
56
import org.utbot.framework.plugin.api.CodegenLanguage
67
import org.utbot.testcheckers.eq
78
import org.utbot.testcheckers.ge
8-
import org.utbot.testing.CodeGeneration
9-
import org.utbot.testing.UtValueTestCaseChecker
10-
import org.utbot.testing.ignoreExecutionsNumber
11-
import org.utbot.testing.isException
9+
import org.utbot.testing.*
1210

1311
// TODO Kotlin mocks generics https://github.com/UnitTestBot/UTBotJava/issues/88
1412
internal class SortTest : UtValueTestCaseChecker(
1513
testClass = Sort::class,
1614
testCodeGeneration = true,
17-
pipelines = listOf(
18-
TestLastStage(CodegenLanguage.JAVA),
19-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
20-
)
15+
configurations = ignoreKotlinCompilationConfigurations,
2116
) {
2217
@Test
2318
fun testQuickSort() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayOfObjectsTest.kt

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,15 @@
11
package org.utbot.examples.arrays
22

3-
import org.utbot.framework.plugin.api.CodegenLanguage
43
import org.junit.jupiter.api.Test
54
import org.utbot.testcheckers.eq
65
import org.utbot.testcheckers.ge
7-
import org.utbot.testing.CodeGeneration
8-
import org.utbot.testing.DoNotCalculate
9-
import org.utbot.testing.UtValueTestCaseChecker
10-
import org.utbot.testing.atLeast
11-
import org.utbot.testing.between
12-
import org.utbot.testing.ignoreExecutionsNumber
13-
import org.utbot.testing.isException
6+
import org.utbot.testing.*
147

158
// TODO failed Kotlin compilation SAT-1332
169
internal class ArrayOfObjectsTest : UtValueTestCaseChecker(
1710
testClass = ArrayOfObjects::class,
1811
testCodeGeneration = true,
19-
pipelines = listOf(
20-
TestLastStage(CodegenLanguage.JAVA),
21-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
22-
)
12+
configurations = ignoreKotlinCompilationConfigurations,
2313
) {
2414
@Test
2515
fun testDefaultValues() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArrayStoreExceptionExamplesTest.kt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,15 @@ package org.utbot.examples.arrays
22

33
import org.junit.jupiter.api.Disabled
44
import org.junit.jupiter.api.Test
5-
import org.utbot.framework.plugin.api.CodegenLanguage
65
import org.utbot.testcheckers.eq
76
import org.utbot.testing.AtLeast
8-
import org.utbot.testing.CodeGeneration
97
import org.utbot.testing.UtValueTestCaseChecker
108
import org.utbot.testing.isException
119

1210
class ArrayStoreExceptionExamplesTest : UtValueTestCaseChecker(
1311
testClass = ArrayStoreExceptionExamples::class,
14-
pipelines = listOf(
15-
TestLastStage(CodegenLanguage.JAVA),
16-
// Type inference errors in generated Kotlin code
17-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
18-
)
12+
// Type inference errors in generated Kotlin code
13+
configurations = ignoreKotlinCompilationConfigurations,
1914
) {
2015
@Test
2116
fun testCorrectAssignmentSamePrimitiveType() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/ArraysOverwriteValueTest.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
package org.utbot.examples.arrays
22

3-
import org.utbot.framework.plugin.api.CodegenLanguage
43
import org.junit.jupiter.api.Test
54
import org.utbot.testcheckers.eq
6-
import org.utbot.testing.CodeGeneration
75
import org.utbot.testing.UtValueTestCaseChecker
86

97
// TODO failed Kotlin compilation SAT-1332
108
class ArraysOverwriteValueTest : UtValueTestCaseChecker(
119
testClass = ArraysOverwriteValue::class,
1210
testCodeGeneration = true,
13-
pipelines = listOf(
14-
TestLastStage(CodegenLanguage.JAVA),
15-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
16-
)
11+
configurations = ignoreKotlinCompilationConfigurations,
1712
) {
1813
@Test
1914
fun testByteArray() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/IntArrayBasicsTest.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
package org.utbot.examples.arrays
22

33
import org.junit.jupiter.api.Disabled
4-
import org.utbot.framework.plugin.api.CodegenLanguage
54
import org.junit.jupiter.api.Test
65
import org.utbot.testcheckers.eq
76
import org.utbot.testcheckers.ge
8-
import org.utbot.testing.CodeGeneration
97
import org.utbot.testing.UtValueTestCaseChecker
108
import org.utbot.testing.ignoreExecutionsNumber
119
import org.utbot.testing.isException
@@ -14,10 +12,7 @@ import org.utbot.testing.isException
1412
internal class IntArrayBasicsTest : UtValueTestCaseChecker(
1513
testClass = IntArrayBasics::class,
1614
testCodeGeneration = true,
17-
pipelines = listOf(
18-
TestLastStage(CodegenLanguage.JAVA),
19-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
20-
)
15+
configurations = ignoreKotlinCompilationConfigurations,
2116
) {
2217
@Test
2318
fun testIntArrayWithAssumeOrExecuteConcretely() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/arrays/PrimitiveArraysTest.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package org.utbot.examples.arrays
22

3-
import org.utbot.framework.plugin.api.CodegenLanguage
43
import org.junit.jupiter.api.Test
54
import org.utbot.testcheckers.eq
6-
import org.utbot.testing.CodeGeneration
75
import org.utbot.testing.UtValueTestCaseChecker
86
import org.utbot.testing.atLeast
97
import org.utbot.testing.isException
@@ -12,10 +10,7 @@ import org.utbot.testing.isException
1210
internal class PrimitiveArraysTest : UtValueTestCaseChecker(
1311
testClass = PrimitiveArrays::class,
1412
testCodeGeneration = true,
15-
pipelines = listOf(
16-
TestLastStage(CodegenLanguage.JAVA),
17-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
18-
)
13+
configurations = ignoreKotlinCompilationConfigurations,
1914
) {
2015
@Test
2116
fun testDefaultIntValues() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/ArrayCastExampleTest.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package org.utbot.examples.casts
22

33
import org.junit.jupiter.api.Disabled
4-
import org.utbot.framework.plugin.api.CodegenLanguage
54
import org.junit.jupiter.api.Test
65
import org.utbot.testcheckers.eq
7-
import org.utbot.testing.CodeGeneration
86
import org.utbot.testing.DoNotCalculate
97
import org.utbot.testing.UtValueTestCaseChecker
108

@@ -13,10 +11,7 @@ import org.utbot.testing.UtValueTestCaseChecker
1311
internal class ArrayCastExampleTest : UtValueTestCaseChecker(
1412
testClass = ArrayCastExample::class,
1513
testCodeGeneration = true,
16-
pipelines = listOf(
17-
TestLastStage(CodegenLanguage.JAVA),
18-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
19-
)
14+
configurations = ignoreKotlinCompilationConfigurations,
2015
) {
2116
@Test
2217
fun testCastToAncestor() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastClassTest.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
package org.utbot.examples.casts
22

33
import org.junit.jupiter.api.Test
4-
import org.utbot.framework.plugin.api.CodegenLanguage
54
import org.utbot.testcheckers.eq
6-
import org.utbot.testing.CodeGeneration
75
import org.utbot.testing.DoNotCalculate
86
import org.utbot.testing.UtValueTestCaseChecker
97

108
internal class CastClassTest : UtValueTestCaseChecker(
119
testClass = CastClass::class,
1210
testCodeGeneration = true,
13-
pipelines = listOf(
14-
TestLastStage(CodegenLanguage.JAVA),
15-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
16-
)
11+
configurations = ignoreKotlinCompilationConfigurations,
1712
) {
1813
@Test
1914
fun testThisTypeChoice() {

utbot-framework-test/src/test/kotlin/org/utbot/examples/casts/CastExampleTest.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package org.utbot.examples.casts
22

3-
import org.utbot.framework.plugin.api.CodegenLanguage
43
import org.junit.jupiter.api.Test
54
import org.utbot.testcheckers.eq
6-
import org.utbot.testing.CodeGeneration
75
import org.utbot.testing.DoNotCalculate
86
import org.utbot.testing.UtValueTestCaseChecker
97
import org.utbot.testing.isException
@@ -12,10 +10,7 @@ import org.utbot.testing.isException
1210
internal class CastExampleTest : UtValueTestCaseChecker(
1311
testClass = CastExample::class,
1412
testCodeGeneration = true,
15-
pipelines = listOf(
16-
TestLastStage(CodegenLanguage.JAVA),
17-
TestLastStage(CodegenLanguage.KOTLIN, CodeGeneration)
18-
)
13+
configurations = ignoreKotlinCompilationConfigurations,
1914
) {
2015
@Test
2116
fun testSimpleCast() {

0 commit comments

Comments
 (0)