backend/tests: Add compilation logging

This commit is contained in:
Ilya Matveev
2017-01-20 10:16:16 +03:00
parent 8ec33334a4
commit 6efe2b6d31
@@ -38,17 +38,25 @@ 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) {
project.javaexec { def log = new ByteArrayOutputStream()
main = 'org.jetbrains.kotlin.cli.bc.K2NativeKt' try {
classpath = project.configurations.cli_bc project.javaexec {
jvmArgs "-ea", main = 'org.jetbrains.kotlin.cli.bc.K2NativeKt'
"-Dkonan.home=${dist.canonicalPath}", classpath = project.configurations.cli_bc
"-Djava.library.path=${dist.canonicalPath}/konan/nativelib" jvmArgs "-ea",
args("-output", output, "-Dkonan.home=${dist.canonicalPath}",
*filesToCompile, "-Djava.library.path=${dist.canonicalPath}/konan/nativelib"
*moreArgs, args("-output", output,
*project.globalArgs) *filesToCompile,
*moreArgs,
*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 = []