File tree Expand file tree Collapse file tree 3 files changed +19
-9
lines changed
utbot-framework/src/main/kotlin/org/utbot
framework/codegen/model/constructor
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api Expand file tree Collapse file tree 3 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,7 @@ abstract class UtExecution(
103
103
var summary : List <DocStatement >? = null ,
104
104
var testMethodName : String? = null ,
105
105
var displayName : String? = null
106
- ) : UtResult() {
107
- var containsMocking: Boolean = false
108
- }
106
+ ) : UtResult()
109
107
110
108
/* *
111
109
* Symbolic execution.
@@ -138,6 +136,8 @@ class UtSymbolicExecution(
138
136
val staticFields: Set <FieldId >
139
137
get() = stateBefore.statics.keys
140
138
139
+ var containsMocking: Boolean = false
140
+
141
141
override fun toString (): String = buildString {
142
142
append(" UtSymbolicExecution(" )
143
143
appendLine()
Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ import org.utbot.framework.plugin.api.UtExecution
8
8
import org.utbot.framework.plugin.api.UtExecutionFailure
9
9
import org.utbot.framework.plugin.api.UtExecutionSuccess
10
10
import org.utbot.framework.plugin.api.UtMethodTestSet
11
+ import org.utbot.framework.plugin.api.UtSymbolicExecution
11
12
import org.utbot.framework.plugin.api.util.objectClassId
12
13
import org.utbot.framework.plugin.api.util.voidClassId
14
+ import org.utbot.fuzzer.UtFuzzedExecution
13
15
import soot.jimple.JimpleBody
14
16
15
17
data class CgMethodTestSet private constructor(
@@ -69,8 +71,12 @@ data class CgMethodTestSet private constructor(
69
71
* Excludes executions with mocking from [CgMethodTestSet].
70
72
* */
71
73
fun excludeExecutionsWithMocking (): CgMethodTestSet {
72
- val executionsWithoutMocking = executions.filter { ! it.containsMocking }
73
- return substituteExecutions(executionsWithoutMocking)
74
+ val fuzzedExecutions = executions.filterIsInstance<UtFuzzedExecution >()
75
+ val symbolicExecutionsWithoutMocking = executions
76
+ .filterIsInstance<UtSymbolicExecution >()
77
+ .filter { ! it.containsMocking }
78
+
79
+ return substituteExecutions(symbolicExecutionsWithoutMocking + fuzzedExecutions)
74
80
}
75
81
76
82
/* *
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import org.utbot.framework.plugin.api.TestCaseGenerator
16
16
import org.utbot.framework.plugin.api.UtError
17
17
import org.utbot.framework.plugin.api.UtExecution
18
18
import org.utbot.framework.plugin.api.UtMethodTestSet
19
+ import org.utbot.framework.plugin.api.UtSymbolicExecution
19
20
import org.utbot.framework.plugin.api.util.id
20
21
import org.utbot.framework.plugin.services.JdkInfoDefaultProvider
21
22
import org.utbot.framework.util.Conflict
@@ -69,13 +70,16 @@ class TestSpecificTestCaseGenerator(
69
70
.collect {
70
71
when (it) {
71
72
is UtExecution -> {
72
- if (
73
- conflictTriggers.triggered(Conflict .ForceMockHappened ) ||
74
- conflictTriggers.triggered(Conflict .ForceStaticMockHappened )
73
+ if (it is UtSymbolicExecution &&
74
+ ( conflictTriggers.triggered(Conflict .ForceMockHappened ) ||
75
+ conflictTriggers.triggered(Conflict .ForceStaticMockHappened ) )
75
76
) {
76
77
it.containsMocking = true
77
78
78
- conflictTriggers.reset(Conflict .ForceMockHappened , Conflict .ForceStaticMockHappened )
79
+ conflictTriggers.reset(
80
+ Conflict .ForceMockHappened ,
81
+ Conflict .ForceStaticMockHappened
82
+ )
79
83
}
80
84
executions + = it
81
85
}
You can’t perform that action at this time.
0 commit comments