Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 45
Summaries for tests generated by fuzzer are generated in the summary module #597#599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
ac224e610f16297ceeb4b010a8d1d111e5be9c62b7555470546f853381e0759707b6a1fede3eb0af780c01d68e20722fed1240c20File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -135,31 +135,49 @@ data class Step( | ||
| */ | ||
| sealed class UtResult | ||
| /** | ||
| * Execution. | ||
| * | ||
| * Contains: | ||
| * - execution parameters, including thisInstance; | ||
| * - result; | ||
| * - static fields changed during execution; | ||
| * - required instrumentation details (such as randoms, time, static methods). | ||
| * - coverage information (instructions) if this execution was obtained from the concrete execution. | ||
| * - the engine type that created this execution. | ||
| * - comments, method names and display names created by utbot-summary module. | ||
| */ | ||
| data class UtExecution( | ||
| open class UtExecution( | ||
| val stateBefore: EnvironmentModels, | ||
| val stateAfter: EnvironmentModels, | ||
| val result: UtExecutionResult, | ||
| val instrumentation: List<UtInstrumentation>, | ||
| val path: MutableList<Step>, | ||
| val fullPath: List<Step>, | ||
| val coverage: Coverage? = null, | ||
| val createdBy: UtExecutionCreator? = null, | ||
| var summary: List<DocStatement>? = null, | ||
| var testMethodName: String? = null, | ||
| var displayName: String? = null, | ||
| ) : UtResult() { | ||
| var displayName: String? = null | ||
| ) : UtResult() | ||
| /** | ||
| * Symbolic execution. | ||
| * | ||
| * Contains: | ||
| * - execution parameters, including thisInstance; | ||
| * - result; | ||
| * - static fields changed during execution; | ||
| * - required instrumentation details (such as randoms, time, static methods). | ||
| * - coverage information (instructions) if this execution was obtained from the concrete execution. | ||
| * - comments, method names and display names created by utbot-summary module. | ||
| */ | ||
| class UtSymbolicExecution( | ||
amandelpie marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| stateBefore: EnvironmentModels, | ||
| stateAfter: EnvironmentModels, | ||
| result: UtExecutionResult, | ||
| val instrumentation: List<UtInstrumentation>, | ||
| val path: MutableList<Step>, | ||
| val fullPath: List<Step>, | ||
| coverage: Coverage? = null, | ||
| summary: List<DocStatement>? = null, | ||
| testMethodName: String? = null, | ||
| displayName: String? = null | ||
| ) : UtExecution(stateBefore, stateAfter, result, coverage, summary, testMethodName, displayName) { | ||
| /** | ||
| * By design the 'before' and 'after' states contain info about the same fields. | ||
| * It means that it is not possible for a field to be present at 'before' and to be absent at 'after'. | ||
| @@ -169,7 +187,7 @@ data class UtExecution( | ||
| get() = stateBefore.statics.keys | ||
| override fun toString(): String = buildString { | ||
| append("UtExecution(") | ||
| append("UtSymbolicExecution(") | ||
| appendLine() | ||
| append("<State before>:") | ||
| @@ -190,6 +208,21 @@ data class UtExecution( | ||
| appendOptional("instrumentation", instrumentation) | ||
| append(")") | ||
| } | ||
| fun copy(stateAfter: EnvironmentModels, result: UtExecutionResult, coverage: Coverage): UtResult { | ||
| return UtSymbolicExecution( | ||
| stateBefore, | ||
| stateAfter, | ||
| result, | ||
| instrumentation, | ||
| path, | ||
| fullPath, | ||
| coverage, | ||
| summary, | ||
| testMethodName, | ||
| displayName | ||
| ) | ||
| } | ||
| } | ||
| open class EnvironmentModels( | ||
| @@ -209,7 +242,7 @@ open class EnvironmentModels( | ||
| } | ||
| /** | ||
| * Represents missing state. Useful for [UtConcreteExecutionFailure] because it does not have [UtExecution.stateAfter] | ||
| * Represents missing state. Useful for [UtConcreteExecutionFailure] because it does not have [UtSymbolicExecution.stateAfter] | ||
| */ | ||
| object MissingState : EnvironmentModels( | ||
| thisInstance = null, | ||
| @@ -553,12 +586,12 @@ data class UtDirectSetFieldModel( | ||
| val fieldModel: UtModel, | ||
| ) : UtStatementModel(instance) { | ||
| override fun toString(): String = withToStringThreadLocalReentrancyGuard { | ||
| val modelRepresentation = when (fieldModel) { | ||
| is UtAssembleModel -> fieldModel.modelName | ||
| else -> fieldModel.toString() | ||
| } | ||
| "${instance.modelName}.${fieldId.name} = $modelRepresentation" | ||
| val modelRepresentation = when (fieldModel) { | ||
| is UtAssembleModel -> fieldModel.modelName | ||
| else -> fieldModel.toString() | ||
| } | ||
| "${instance.modelName}.${fieldId.name} = $modelRepresentation" | ||
| } | ||
| } | ||
| @@ -1034,7 +1067,7 @@ class BuiltinMethodId( | ||
| open class TypeParameters(val parameters: List<ClassId> = emptyList()) | ||
| class WildcardTypeParameter: TypeParameters(emptyList()) | ||
| class WildcardTypeParameter: TypeParameters(emptyList()) | ||
| interface CodeGenerationSettingItem { | ||
| val displayName: String | ||
| @@ -1164,6 +1197,7 @@ enum class CodegenLanguage( | ||
| "-cp", classPath, | ||
| "-XDignore.symbol.file" // to let javac use classes from rt.jar | ||
| ).plus(sourcesFiles) | ||
| KOTLIN -> listOf("-d", buildDirectory, "-jvm-target", jvmTarget, "-cp", classPath).plus(sourcesFiles) | ||
| } | ||
| if (this == KOTLIN && System.getenv("KOTLIN_HOME") == null) { | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -30,6 +30,7 @@ import org.utbot.framework.plugin.api.UtModel | ||
| import org.utbot.framework.plugin.api.UtNullModel | ||
| import org.utbot.framework.plugin.api.UtPrimitiveModel | ||
| import org.utbot.framework.plugin.api.UtReferenceModel | ||
| import org.utbot.framework.plugin.api.UtSymbolicExecution | ||
| import org.utbot.framework.plugin.api.UtValueExecution | ||
| import org.utbot.framework.plugin.api.UtValueExecutionState | ||
| import org.utbot.framework.plugin.api.UtVoidModel | ||
| @@ -123,17 +124,31 @@ class ValueConstructor { | ||
| val (stateAfter, _) = constructState(execution.stateAfter) | ||
| val returnValue = execution.result.map { construct(listOf(it)).single().value } | ||
| return UtValueExecution( | ||
| stateBefore, | ||
| stateAfter, | ||
| returnValue, | ||
| execution.path, | ||
| mocks, | ||
| execution.instrumentation, | ||
| execution.summary, | ||
| execution.testMethodName, | ||
| execution.displayName | ||
| ) | ||
| if (execution is UtSymbolicExecution) { | ||
Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor: | ||
| return UtValueExecution( | ||
| stateBefore, | ||
| stateAfter, | ||
| returnValue, | ||
| execution.path, | ||
| mocks, | ||
| execution.instrumentation, | ||
| execution.summary, | ||
| execution.testMethodName, | ||
| execution.displayName | ||
| ) | ||
| } else { | ||
| return UtValueExecution( | ||
| stateBefore, | ||
| stateAfter, | ||
| returnValue, | ||
| emptyList(), | ||
| mocks, | ||
| emptyList(), | ||
| execution.summary, | ||
| execution.testMethodName, | ||
| execution.displayName | ||
| ) | ||
| } | ||
| } | ||
| private fun constructParamsAndMocks( | ||
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.