backend/tests: enable hello0

This commit is contained in:
Svyatoslav Scherbina
2016-11-07 01:04:03 +07:00
committed by SvyatoslavScherbina
parent 674713f429
commit 451ac00087
+14 -14
View File
@@ -53,21 +53,20 @@ abstract class KonanTest extends DefaultTask {
def exe = new File(sourceS.absolutePath.replace(".kt.S", "")) def exe = new File(sourceS.absolutePath.replace(".kt.S", ""))
compileTest(sourceS, bc2s(runtimeBc), exe) compileTest(sourceS, bc2s(runtimeBc), exe)
println "execution :${exe.absolutePath}" println "execution :${exe.absolutePath}"
if (testData == null) {
project.exec { def out = null
commandLine "${exe.absolutePath}" project.exec {
} commandLine "${exe.absolutePath}"
} if (testData != null) {
else {
def out = new ByteArrayOutputStream()
project.exec {
commandLine "${exe.absolutePath}"
standardInput = new ByteArrayInputStream(testData.bytes) standardInput = new ByteArrayInputStream(testData.bytes)
}
if (goldValue != null) {
out = new ByteArrayOutputStream()
standardOutput = out standardOutput = out
} }
if (goldValue != out.toString())
throw new RuntimeException("test failed")
} }
if (goldValue != null && goldValue != out.toString())
throw new RuntimeException("test failed")
} }
private File bc2s(File bcFile) { private File bc2s(File bcFile) {
@@ -157,9 +156,10 @@ task local_variable(type: UnitKonanTest) {
source = "codegen/basics/local_variable.kt" source = "codegen/basics/local_variable.kt"
} }
//task hello0(type: RunKonanTest) { task hello0(type: RunKonanTest) {
// source = "runtime/basic/hello0.kt" goldValue = "Hello, world!"
//} source = "runtime/basic/hello0.kt"
}
task hello1(type: RunKonanTest) { task hello1(type: RunKonanTest) {
goldValue = "Hello World" goldValue = "Hello World"