From 451ac000876c0ef838d01df6cc929ab8528fff33 Mon Sep 17 00:00:00 2001 From: Svyatoslav Scherbina Date: Mon, 7 Nov 2016 01:04:03 +0700 Subject: [PATCH] backend/tests: enable hello0 --- backend.native/tests/build.gradle | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/backend.native/tests/build.gradle b/backend.native/tests/build.gradle index 4ae269b70f8..96f8f232324 100644 --- a/backend.native/tests/build.gradle +++ b/backend.native/tests/build.gradle @@ -53,21 +53,20 @@ abstract class KonanTest extends DefaultTask { def exe = new File(sourceS.absolutePath.replace(".kt.S", "")) compileTest(sourceS, bc2s(runtimeBc), exe) println "execution :${exe.absolutePath}" - if (testData == null) { - project.exec { - commandLine "${exe.absolutePath}" - } - } - else { - def out = new ByteArrayOutputStream() - project.exec { - commandLine "${exe.absolutePath}" + + def out = null + project.exec { + commandLine "${exe.absolutePath}" + if (testData != null) { standardInput = new ByteArrayInputStream(testData.bytes) + } + if (goldValue != null) { + out = new ByteArrayOutputStream() 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) { @@ -157,9 +156,10 @@ task local_variable(type: UnitKonanTest) { source = "codegen/basics/local_variable.kt" } -//task hello0(type: RunKonanTest) { -// source = "runtime/basic/hello0.kt" -//} +task hello0(type: RunKonanTest) { + goldValue = "Hello, world!" + source = "runtime/basic/hello0.kt" +} task hello1(type: RunKonanTest) { goldValue = "Hello World"