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