@@ -4,7 +4,6 @@ import org.utbot.framework.plugin.api.CodegenLanguage
4
4
import java.io.File
5
5
import java.nio.file.Path
6
6
import org.utbot.common.FileUtil
7
- import org.utbot.engine.logger
8
7
import org.utbot.framework.codegen.Junit5
9
8
import org.utbot.framework.codegen.TestFramework
10
9
@@ -33,7 +32,7 @@ fun writeTest(
33
32
File (buildDirectory.toFile(), " ${testClassName.substringAfterLast(" ." )}${generatedLanguage.extension} " )
34
33
)
35
34
36
- org.utbot.testing. logger.info {
35
+ logger.info {
37
36
" File size for ${classUnderTest.testClassSimpleName} : ${FileUtil .byteCountToDisplaySize(testContents.length.toLong())} "
38
37
}
39
38
return writeFile(testContents, classUnderTest.generatedTestFile)
@@ -47,9 +46,9 @@ fun compileTests(
47
46
val classpath = System .getProperty(" java.class.path" )
48
47
val command = generatedLanguage.getCompilationCommand(buildDirectory, classpath, sourcesFiles)
49
48
50
- org.utbot.testing. logger.trace { " Command to compile [${sourcesFiles.joinToString(" " )} ]: [${command.joinToString(" " )} ]" }
49
+ logger.trace { " Command to compile [${sourcesFiles.joinToString(" " )} ]: [${command.joinToString(" " )} ]" }
51
50
val exitCode = execCommandLine(command, " Tests compilation" )
52
- org.utbot.testing. logger.info { " Compilation exit code: $exitCode " }
51
+ logger.info { " Compilation exit code: $exitCode " }
53
52
}
54
53
55
54
fun runTests (
@@ -74,7 +73,7 @@ fun runTests(
74
73
additionalArguments
75
74
)
76
75
77
- org.utbot.testing. logger.trace { " Command to run test: [${command.joinToString(" " )} ]" }
76
+ logger.trace { " Command to run test: [${command.joinToString(" " )} ]" }
78
77
79
78
// We use argument file to pass classpath, so we should just call execCommand.
80
79
// Because of some reason, it is impossible to use the same approach with Junit4 and TestNg, therefore,
@@ -85,7 +84,7 @@ fun runTests(
85
84
setClassPathAndExecCommandLine(command, " Tests execution" , classpath)
86
85
}
87
86
88
- org.utbot.testing. logger.info { " Run for [${testsNames.joinToString(" " )} ] completed with exit code: $exitCode " }
87
+ logger.info { " Run for [${testsNames.joinToString(" " )} ] completed with exit code: $exitCode " }
89
88
}
90
89
91
90
/* *
@@ -105,13 +104,13 @@ private fun constructProcess(command: List<String>, classpath: String? = null):
105
104
private fun generateReportByProcess (process : Process , executionName : String , command : List <String >): Int {
106
105
val report = process.inputStream.reader().readText()
107
106
108
- org.utbot.testing. logger.info { " $executionName report: [$report ]" }
107
+ logger.info { " $executionName report: [$report ]" }
109
108
110
109
val exitCode = process.waitFor()
111
110
112
111
if (exitCode != 0 ) {
113
- org.utbot.testing. logger.warn { " Exit code for process run: $exitCode " }
114
- org.utbot.testing. logger.warn { " The command line led to the pipeline failure: [${command.joinToString(" " )} ]" }
112
+ logger.warn { " Exit code for process run: $exitCode " }
113
+ logger.warn { " The command line led to the pipeline failure: [${command.joinToString(" " )} ]" }
115
114
throw RuntimeException (" $executionName failed with non-zero exit code = $exitCode " )
116
115
}
117
116
0 commit comments