Skip to content

Commit 95d4dc5

Browse files
committed
Make JcMachine's budget distributing strategy and refactor
1 parent 273335e commit 95d4dc5

18 files changed

+299
-281
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ commonsIOVersion=2.11.0
102102
javaxVersion=2.2
103103
jakartaVersion=3.1.0
104104
jacoDbVersion=1.4.1
105-
usvmVersion=comp-231118-1620
105+
usvmVersion=comp-231120-1719
106106

107107
# use latest Java 8 compaitable Spring and Spring Boot versions
108108
springVersion=5.3.28

utbot-junit-contest/src/main/kotlin/org/utbot/contest/ContestEstimator.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import org.utbot.contest.Paths.evosuiteReportFile
2626
import org.utbot.contest.Paths.jarsDir
2727
import org.utbot.contest.Paths.moduleTestDir
2828
import org.utbot.contest.Paths.outputDir
29-
import org.utbot.contest.usvm.executor.UTestRunner
29+
import org.utbot.contest.usvm.jc.JcContainer
3030
import org.utbot.contest.usvm.runUsvmGeneration
3131
import org.utbot.features.FeatureExtractorFactoryImpl
3232
import org.utbot.features.FeatureProcessorWithStatesRepetitionFactory
@@ -266,8 +266,7 @@ interface Tool {
266266
)
267267

268268
override fun close() {
269-
if (UTestRunner.isInitialized())
270-
UTestRunner.runner.close()
269+
JcContainer.close()
271270
}
272271
}
273272

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/ContestUsvm.kt

Lines changed: 129 additions & 138 deletions
Large diffs are not rendered by default.

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/EnvironmentStateKind.kt

Lines changed: 0 additions & 5 deletions
This file was deleted.

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/InstructionIdProvider.kt

Lines changed: 0 additions & 8 deletions
This file was deleted.

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/JacoDBContainer.kt

Lines changed: 0 additions & 44 deletions
This file was deleted.

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/Utils.kt

Lines changed: 0 additions & 16 deletions
This file was deleted.

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/ConverterUtils.kt renamed to utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/converter/ConverterUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.utbot.contest.usvm
1+
package org.utbot.contest.usvm.converter
22

33
import org.jacodb.analysis.library.analyzers.thisInstance
44
import org.jacodb.api.JcArrayType
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package org.utbot.contest.usvm.converter
2+
3+
fun interface InstructionIdProvider {
4+
fun provideInstructionId(methodSignature: String, instIndex: Int): Long
5+
}
6+
7+
class SimpleInstructionIdProvider : InstructionIdProvider {
8+
private val instructionIds = mutableMapOf<Pair<String, Int>, Long>()
9+
10+
override fun provideInstructionId(methodSignature: String, instIndex: Int): Long =
11+
instructionIds.getOrPut(methodSignature to instIndex) { instructionIds.size.toLong() }
12+
}

utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/JcToUtExecutionConverter.kt renamed to utbot-junit-contest/src/main/kotlin/org/utbot/contest/usvm/converter/JcToUtExecutionConverter.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.utbot.contest.usvm
1+
package org.utbot.contest.usvm.converter
22

33
import mu.KotlinLogging
44
import org.jacodb.api.JcClassOrInterface
@@ -18,7 +18,7 @@ import org.usvm.instrumentation.testcase.descriptor.UTestExceptionDescriptor
1818
import org.usvm.instrumentation.util.enclosingClass
1919
import org.usvm.instrumentation.util.enclosingMethod
2020
import org.utbot.common.isPublic
21-
import org.utbot.contest.usvm.executor.JcExecution
21+
import org.utbot.contest.usvm.jc.JcExecution
2222
import org.utbot.framework.codegen.domain.builtin.UtilMethodProvider
2323
import org.utbot.framework.plugin.api.ClassId
2424
import org.utbot.framework.plugin.api.Coverage
@@ -58,7 +58,7 @@ class JcToUtExecutionConverter(
5858
private var jcToUtModelConverter: JcToUtModelConverter
5959

6060
init {
61-
val instToModelConverter = UTestInst2UtModelConverter(idGenerator, jcClasspath, utilMethodProvider)
61+
val instToModelConverter = UTestInstToUtModelConverter(idGenerator, jcClasspath, utilMethodProvider)
6262

6363
instToModelConverter.processUTest(jcExecution.uTest)
6464
jcToUtModelConverter = JcToUtModelConverter(idGenerator, jcClasspath, instToModelConverter)

0 commit comments

Comments
 (0)