backend/tests: Add compilation logging
This commit is contained in:
@@ -38,6 +38,8 @@ abstract class KonanTest extends DefaultTask {
|
|||||||
abstract void compileTest(List<String> filesToCompile, String exe)
|
abstract void compileTest(List<String> filesToCompile, String exe)
|
||||||
|
|
||||||
protected void runCompiler(List<String> filesToCompile, String output, List<String> moreArgs) {
|
protected void runCompiler(List<String> filesToCompile, String output, List<String> moreArgs) {
|
||||||
|
def log = new ByteArrayOutputStream()
|
||||||
|
try {
|
||||||
project.javaexec {
|
project.javaexec {
|
||||||
main = 'org.jetbrains.kotlin.cli.bc.K2NativeKt'
|
main = 'org.jetbrains.kotlin.cli.bc.K2NativeKt'
|
||||||
classpath = project.configurations.cli_bc
|
classpath = project.configurations.cli_bc
|
||||||
@@ -48,7 +50,13 @@ abstract class KonanTest extends DefaultTask {
|
|||||||
*filesToCompile,
|
*filesToCompile,
|
||||||
*moreArgs,
|
*moreArgs,
|
||||||
*project.globalArgs)
|
*project.globalArgs)
|
||||||
|
standardOutput = log
|
||||||
|
errorOutput = log
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
def logString = log.toString()
|
||||||
|
project.file("${output}.compilation.log").write(logString)
|
||||||
|
println(logString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -128,12 +136,6 @@ class RunExternalTestGroup extends RunKonanTest {
|
|||||||
String filter = project.findProperty("filter")
|
String filter = project.findProperty("filter")
|
||||||
String goldValue = "OK"
|
String goldValue = "OK"
|
||||||
|
|
||||||
String buildExePath() {
|
|
||||||
def exeName = "${name}.kt.exe"
|
|
||||||
def tempDir = temporaryDir.absolutePath
|
|
||||||
return "$tempDir/$exeName"
|
|
||||||
}
|
|
||||||
|
|
||||||
// TODO refactor
|
// TODO refactor
|
||||||
List<String> buildCompileList() {
|
List<String> buildCompileList() {
|
||||||
def result = []
|
def result = []
|
||||||
|
|||||||
Reference in New Issue
Block a user