Skip to content

Commit 1ac9fcd

Browse files
committed
Move testing utilities in a separate module
1 parent 31600f6 commit 1ac9fcd

File tree

190 files changed

+21836
-4
lines changed

Some content is hidden

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

190 files changed

+21836
-4
lines changed

utbot-analytics/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ dependencies {
3333
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.9'
3434
implementation group: 'com.github.javaparser', name: 'javaparser-core', version: '3.22.1'
3535

36-
testImplementation project(':utbot-framework-test').sourceSets.main.output
36+
testImplementation project(':utbot-testing')
3737
testImplementation project(':utbot-framework').sourceSets.test.output
3838
}
3939

utbot-framework-test/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
22
kotlinOptions {
3-
jvmTarget = JavaVersion.VERSION_1_8
3+
jvmTarget = JavaVersion.VERSION_11
44
freeCompilerArgs += ["-Xallow-result-return-type", "-Xsam-conversions=class"]
55
}
66
}
@@ -22,6 +22,7 @@ configurations {
2222

2323
dependencies {
2424
api project(':utbot-framework-api')
25+
testImplementation project(':utbot-testing')
2526

2627
api project(':utbot-fuzzers')
2728
api project(':utbot-instrumentation')

utbot-summary-tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies {
1010
implementation(project(':utbot-instrumentation'))
1111
testImplementation project(':utbot-sample')
1212
testImplementation group: 'junit', name: 'junit', version: junit4Version
13-
testImplementation project(':utbot-framework-test').sourceSets.main.output
13+
testImplementation project(':utbot-testing')
1414
testImplementation project(':utbot-framework').sourceSets.test.output
1515
}
1616

utbot-summary-tests/src/test/kotlin/examples/SummaryTestCaseGeneratorTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import org.utbot.summary.comment.nextSynonyms
1313
import org.utbot.summary.summarize
1414
import kotlin.reflect.KClass
1515
import kotlin.reflect.KFunction
16-
16+
import org.utbot.testing.DoNotCalculate
17+
import org.utbot.testing.TestLastStage
1718

1819
private const val NEW_LINE = "\n"
1920
private const val POINT_IN_THE_LIST = " * "

utbot-summary-tests/src/test/kotlin/examples/algorithms/SummaryArrayQuickSortExampleTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import org.utbot.examples.algorithms.ArraysQuickSort
77

88
import org.utbot.framework.plugin.api.MockStrategyApi
99
import org.utbot.framework.plugin.api.UtClusterInfo
10+
import org.utbot.testing.DoNotCalculate
1011

1112
@Tag("slow")
1213
class SummaryArrayQuickSortExampleTest : SummaryTestCaseGeneratorTest(

utbot-summary-tests/src/test/kotlin/examples/controlflow/SummaryConditionsTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import examples.CustomJavaDocTagsEnabler
44
import examples.SummaryTestCaseGeneratorTest
55
import org.junit.jupiter.api.Test
66
import org.junit.jupiter.api.extension.ExtendWith
7+
import org.utbot.testing.DoNotCalculate
78

89
import org.utbot.examples.controlflow.Conditions
910
import org.utbot.framework.plugin.api.MockStrategyApi

utbot-summary-tests/src/test/kotlin/examples/controlflow/SummarySwitchTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test
66
import org.junit.jupiter.api.extension.ExtendWith
77
import org.utbot.examples.controlflow.Switch
88
import org.utbot.framework.plugin.api.MockStrategyApi
9+
import org.utbot.testing.DoNotCalculate
910

1011
@ExtendWith(CustomJavaDocTagsEnabler::class)
1112
class SummarySwitchTest : SummaryTestCaseGeneratorTest(

utbot-summary-tests/src/test/kotlin/examples/enums/ComplexEnumExampleTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test
66
import org.junit.jupiter.api.extension.ExtendWith
77
import org.utbot.examples.enums.ComplexEnumExamples
88
import org.utbot.framework.plugin.api.MockStrategyApi
9+
import org.utbot.testing.DoNotCalculate
910

1011

1112
@ExtendWith(CustomJavaDocTagsEnabler::class)

utbot-summary-tests/src/test/kotlin/examples/exceptions/SummaryExceptionClusteringExamplesTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import examples.CustomJavaDocTagsEnabler
44
import examples.SummaryTestCaseGeneratorTest
55
import org.junit.jupiter.api.Test
66
import org.junit.jupiter.api.extension.ExtendWith
7+
import org.utbot.testing.DoNotCalculate
78

89
import org.utbot.examples.exceptions.ExceptionClusteringExamples
910
import org.utbot.framework.plugin.api.MockStrategyApi

utbot-summary-tests/src/test/kotlin/examples/exceptions/SummaryExceptionExampleTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test
66
import org.junit.jupiter.api.extension.ExtendWith
77
import org.utbot.examples.exceptions.ExceptionExamples
88
import org.utbot.framework.plugin.api.MockStrategyApi
9+
import org.utbot.testing.DoNotCalculate
910

1011

1112
@ExtendWith(CustomJavaDocTagsEnabler::class)

utbot-summary-tests/src/test/kotlin/examples/recursion/SummaryRecursionTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test
66
import org.junit.jupiter.api.extension.ExtendWith
77
import org.utbot.examples.recursion.Recursion
88
import org.utbot.framework.plugin.api.MockStrategyApi
9+
import org.utbot.testing.DoNotCalculate
910

1011
@ExtendWith(CustomJavaDocTagsEnabler::class)
1112
class SummaryRecursionTest : SummaryTestCaseGeneratorTest(

utbot-summary-tests/src/test/kotlin/examples/unsafe/UnsafeWithFieldTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import org.junit.jupiter.api.Test
66
import org.junit.jupiter.api.extension.ExtendWith
77
import org.utbot.examples.unsafe.UnsafeWithField
88
import org.utbot.framework.plugin.api.MockStrategyApi
9+
import org.utbot.testing.DoNotCalculate
910

1011
@ExtendWith(CustomJavaDocTagsEnabler::class)
1112
class UnsafeWithFieldTest : SummaryTestCaseGeneratorTest(

utbot-summary-tests/src/test/kotlin/math/SummaryOfMathTest.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import org.junit.jupiter.api.Test
77

88
import org.utbot.framework.plugin.api.MockStrategyApi
99
import org.utbot.framework.plugin.api.UtClusterInfo
10+
import org.utbot.testing.DoNotCalculate
1011

1112
/**
1213
* It runs test generation for the poor analogue of the Stats.of method ported from the guava-26.0 framework

utbot-summary/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ dependencies {
1717
implementation("com.github.javaparser:javaparser-core:3.22.1")
1818
testImplementation("org.mockito:mockito-core:4.2.0")
1919
testImplementation("org.junit.jupiter:junit-jupiter:$junit5Version")
20+
testImplementation(project(":utbot-testing"))
2021
}

utbot-testing/build.gradle

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
2+
kotlinOptions {
3+
jvmTarget = JavaVersion.VERSION_1_8
4+
freeCompilerArgs += ["-Xallow-result-return-type", "-Xsam-conversions=class"]
5+
}
6+
}
7+
8+
tasks.withType(JavaCompile) {
9+
sourceCompatibility = JavaVersion.VERSION_1_8
10+
targetCompatibility = JavaVersion.VERSION_1_8
11+
}
12+
13+
repositories {
14+
flatDir {
15+
dirs 'dist'
16+
}
17+
}
18+
19+
configurations {
20+
z3native
21+
}
22+
23+
dependencies {
24+
api project(':utbot-framework-api')
25+
26+
api project(':utbot-fuzzers')
27+
api project(':utbot-instrumentation')
28+
api project(':utbot-summary')
29+
30+
implementation(project(":utbot-framework"))
31+
testImplementation project(':utbot-sample')
32+
testImplementation project(":utbot-framework").sourceSets.test.output
33+
testImplementation project(":utbot-core").sourceSets.test.output
34+
35+
implementation("org.unittestbot.soot:soot-utbot-fork:${sootVersion}") {
36+
exclude group:'com.google.guava', module:'guava'
37+
}
38+
39+
implementation group: 'com.fasterxml.jackson.module', name: 'jackson-module-kotlin', version: jacksonVersion
40+
implementation group: 'org.sosy-lab', name: 'javasmt-solver-z3', version: javasmtSolverZ3Version
41+
implementation group: 'com.github.curious-odd-man', name: 'rgxgen', version: rgxgenVersion
42+
implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: log4j2Version
43+
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlinLoggingVersion
44+
implementation group: 'org.jacoco', name: 'org.jacoco.report', version: jacocoVersion
45+
implementation group: 'org.apache.commons', name: 'commons-text', version: apacheCommonsTextVersion
46+
// we need this for construction mocks from composite models
47+
implementation group: 'org.mockito', name: 'mockito-core', version: '4.2.0'
48+
49+
// To use JUnit4, comment out JUnit5 and uncomment JUnit4 dependencies here. Please also check "test" section
50+
// testImplementation group: 'junit', name: 'junit', version: '4.13.1'
51+
implementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: '5.8.1'
52+
implementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: '5.8.1'
53+
54+
// used for testing code generation
55+
testImplementation group: 'commons-io', name: 'commons-io', version: commonsIoVersion
56+
testImplementation group: 'junit', name: 'junit', version: junit4Version
57+
testImplementation group: 'org.junit.platform', name: 'junit-platform-console-standalone', version: junit4PlatformVersion
58+
testImplementation group: 'org.antlr', name: 'antlr4', version: antlrVersion
59+
testImplementation group: 'org.mockito', name: 'mockito-core', version: mockitoVersion
60+
testImplementation group: 'org.testng', name: 'testng', version: testNgVersion
61+
testImplementation group: 'org.mockito', name: 'mockito-inline', version: mockitoInlineVersion
62+
testImplementation group: 'com.google.guava', name: 'guava', version: guavaVersion
63+
64+
testImplementation group: 'org.mockito', name: 'mockito-inline', version: mockitoInlineVersion
65+
testImplementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4j2Version
66+
67+
z3native group: 'com.microsoft.z3', name: 'z3-native-win64', version: z3Version, ext: 'zip'
68+
z3native group: 'com.microsoft.z3', name: 'z3-native-linux64', version: z3Version, ext: 'zip'
69+
z3native group: 'com.microsoft.z3', name: 'z3-native-osx', version: z3Version, ext: 'zip'
70+
}
71+
72+
73+
test {
74+
75+
minHeapSize = "128m"
76+
maxHeapSize = "2048m"
77+
78+
jvmArgs '-XX:MaxHeapSize=2048m'
79+
80+
// To use JUnit4, comment out useJUnitPlatform and uncomment useJUnit. Please also check "dependencies" section
81+
//useJUnit()
82+
useJUnitPlatform() {
83+
excludeTags 'slow', 'IntegrationTest'
84+
}
85+
if (System.getProperty('DEBUG', 'false') == 'true') {
86+
jvmArgs '-Xdebug', '-Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=9009'
87+
}
88+
}

0 commit comments

Comments
 (0)