File tree Expand file tree Collapse file tree
utbot-python/src/main/kotlin/org/utbot/python Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -64,13 +64,18 @@ fun startEvaluationProcess(input: EvaluationInput): EvaluationProcess {
6464 tag = " out_" + input.method.name + " .py" ,
6565 addToCleaner = false
6666 )
67+ val coverageDatabasePath = TemporaryFileManager .assignTemporaryFile(
68+ tag = " coverage_db_" + input.method.name,
69+ addToCleaner = false ,
70+ )
6771 val runCode = PythonCodeGenerator .generateRunFunctionCode(
6872 input.method,
6973 input.methodArguments,
7074 input.directoriesForSysPath,
7175 input.moduleToImport,
7276 input.additionalModulesToImport,
73- fileForOutput.path.replace(" \\ " , " \\\\ " )
77+ fileForOutput.path.replace(" \\ " , " \\\\ " ),
78+ coverageDatabasePath.absolutePath
7479 )
7580 val fileWithCode = TemporaryFileManager .createTemporaryFile(
7681 runCode,
Original file line number Diff line number Diff line change @@ -20,7 +20,8 @@ object PythonCodeGenerator {
2020 directoriesForSysPath : Set <String >,
2121 moduleToImport : String ,
2222 additionalModules : Set <String > = emptySet(),
23- fileForOutputName : String
23+ fileForOutputName : String ,
24+ coverageDatabasePath : String ,
2425 ): String {
2526 val context = UtContext (this ::class .java.classLoader)
2627 withUtContext(context) {
@@ -36,7 +37,8 @@ object PythonCodeGenerator {
3637 directoriesForSysPath,
3738 moduleToImport,
3839 additionalModules,
39- fileForOutputName
40+ fileForOutputName,
41+ coverageDatabasePath,
4042 )
4143 }
4244 }
Original file line number Diff line number Diff line change @@ -104,7 +104,8 @@ class PythonCodeGenerator(
104104 directoriesForSysPath : Set <String >,
105105 moduleToImport : String ,
106106 additionalModules : Set <String > = emptySet(),
107- fileForOutputName : String
107+ fileForOutputName : String ,
108+ coverageDatabasePath : String ,
108109 ): String {
109110 val cgRendererContext = CgRendererContext .fromCgContext(context)
110111 val printer = CgPrinterImpl ()
@@ -144,13 +145,14 @@ class PythonCodeGenerator(
144145 )
145146
146147 val fullpath = CgLiteral (pythonStrClassId, " '${method.moduleFilename} '" )
147-
148148 val outputPath = CgLiteral (pythonStrClassId, " '$fileForOutputName '" )
149+ val databasePath = CgLiteral (pythonStrClassId, " '$coverageDatabasePath '" )
149150
150151 val executorCall = CgPythonFunctionCall (
151152 pythonNoneClassId,
152153 executorFunctionName,
153154 listOf (
155+ databasePath,
154156 functionName,
155157 args,
156158 kwargs,
You can’t perform that action at this time.
0 commit comments