diff --git a/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy b/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy index e59846e54c5..9c043314071 100644 --- a/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy +++ b/kotlin-native/build-tools/src/main/groovy/org/jetbrains/kotlin/KonanTest.groovy @@ -17,6 +17,8 @@ package org.jetbrains.kotlin import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.Internal import org.gradle.api.tasks.JavaExec import org.gradle.api.tasks.TaskAction import org.gradle.process.ExecResult @@ -31,26 +33,57 @@ import java.util.stream.Collectors import java.io.File class RunExternalTestGroup extends JavaExec implements CompilerRunner { - def platformManager = project.project(":kotlin-native").platformManager - def target = platformManager.targetManager(project.testTarget).target + private def platformManager = project.project(":kotlin-native").platformManager + private def target = platformManager.targetManager(project.testTarget).target + + @Internal def dist = UtilsKt.getKotlinNativeDist(project) + @Input def enableKonanAssertions = true + + @Input def verifyIr = true + + @Input + @Optional String outputDirectory = null + @Input + @Optional String goldValue = null + + @Input // Checks test's output against gold value and returns true if the output matches the expectation Function outputChecker = { str -> (goldValue == null || goldValue == str) } + + @Input boolean printOutput = true + + @Input + @Optional String testData = null + + @Input int expectedExitStatus = 0 + + @Input + @Optional List arguments = null + + @Input + @Optional List flags = null + @Input boolean multiRuns = false + @Input + @Optional List> multiArguments = null + @Input boolean expectedFail = false + + @Input boolean compilerMessages = false // Uses directory defined in $outputSourceSetName source set @@ -125,6 +158,7 @@ class RunExternalTestGroup extends JavaExec implements CompilerRunner { // FIXME: output directory here changes and hence this is not a property String executablePath() { return "$outputDirectory/program.tr" } + @Internal OutputStream out void runExecutable() { @@ -204,15 +238,20 @@ class RunExternalTestGroup extends JavaExec implements CompilerRunner { * 2. Build a final executable from this klibrary. */ @Input - public def enableTwoStageCompilation = false + def enableTwoStageCompilation = false @Input def groupDirectory = "." - def ignoredTests = [] + @Input + @Optional + List ignoredTests = null + @Input + @Optional String filter = project.findProperty("filter") + @Internal def testGroupReporter = new KonanTestGroupReportEnvironment(project) void parseLanguageFlags(String src) {