File tree Expand file tree Collapse file tree 3 files changed +14
-5
lines changed
utbot-python/src/main/kotlin/org/utbot/python Expand file tree Collapse file tree 3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -64,13 +64,18 @@ fun startEvaluationProcess(input: EvaluationInput): EvaluationProcess {
64
64
tag = " out_" + input.method.name + " .py" ,
65
65
addToCleaner = false
66
66
)
67
+ val coverageDatabasePath = TemporaryFileManager .assignTemporaryFile(
68
+ tag = " coverage_db_" + input.method.name,
69
+ addToCleaner = false ,
70
+ )
67
71
val runCode = PythonCodeGenerator .generateRunFunctionCode(
68
72
input.method,
69
73
input.methodArguments,
70
74
input.directoriesForSysPath,
71
75
input.moduleToImport,
72
76
input.additionalModulesToImport,
73
- fileForOutput.path.replace(" \\ " , " \\\\ " )
77
+ fileForOutput.path.replace(" \\ " , " \\\\ " ),
78
+ coverageDatabasePath.absolutePath
74
79
)
75
80
val fileWithCode = TemporaryFileManager .createTemporaryFile(
76
81
runCode,
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ object PythonCodeGenerator {
20
20
directoriesForSysPath : Set <String >,
21
21
moduleToImport : String ,
22
22
additionalModules : Set <String > = emptySet(),
23
- fileForOutputName : String
23
+ fileForOutputName : String ,
24
+ coverageDatabasePath : String ,
24
25
): String {
25
26
val context = UtContext (this ::class .java.classLoader)
26
27
withUtContext(context) {
@@ -36,7 +37,8 @@ object PythonCodeGenerator {
36
37
directoriesForSysPath,
37
38
moduleToImport,
38
39
additionalModules,
39
- fileForOutputName
40
+ fileForOutputName,
41
+ coverageDatabasePath,
40
42
)
41
43
}
42
44
}
Original file line number Diff line number Diff line change @@ -104,7 +104,8 @@ class PythonCodeGenerator(
104
104
directoriesForSysPath : Set <String >,
105
105
moduleToImport : String ,
106
106
additionalModules : Set <String > = emptySet(),
107
- fileForOutputName : String
107
+ fileForOutputName : String ,
108
+ coverageDatabasePath : String ,
108
109
): String {
109
110
val cgRendererContext = CgRendererContext .fromCgContext(context)
110
111
val printer = CgPrinterImpl ()
@@ -144,13 +145,14 @@ class PythonCodeGenerator(
144
145
)
145
146
146
147
val fullpath = CgLiteral (pythonStrClassId, " '${method.moduleFilename} '" )
147
-
148
148
val outputPath = CgLiteral (pythonStrClassId, " '$fileForOutputName '" )
149
+ val databasePath = CgLiteral (pythonStrClassId, " '$coverageDatabasePath '" )
149
150
150
151
val executorCall = CgPythonFunctionCall (
151
152
pythonNoneClassId,
152
153
executorFunctionName,
153
154
listOf (
155
+ databasePath,
154
156
functionName,
155
157
args,
156
158
kwargs,
You can’t perform that action at this time.
0 commit comments