f4e8ae5191
* @ExperimentalForeignApi for all declarations that operate on
unmanaged memory (i.e. pointers and references)
* @BetaInteropApi for the rest of the interoperability declarations,
namely Swift/CInterop-specific interfaces and convenience-functions
### Implementation details
* Some typealiases are not marked explicitly because it crashes the compiler,
yet their experimentality is properly propagated
* License header is adjusted where it previously had been existing
* Deprecated with ERROR interop declarations that are deprecated for more than
two years are removed
* WASM target interop declarations are deprecated
* Deliberately make Boolean.toByte and Byte.toBoolean foreign-experimental to scare
people away
^KT-57728 fixed
Merge-request: KT-MR-9788
Merged-by: Vsevolod Tolstopyatov <qwwdfsad@gmail.com>
6705 lines
214 KiB
Groovy
6705 lines
214 KiB
Groovy
/*
|
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
|
* that can be found in the LICENSE file.
|
|
*/
|
|
|
|
import org.jetbrains.kotlin.gradle.plugin.tasks.KonanCompileNativeBinary
|
|
import org.jetbrains.kotlin.*
|
|
import org.jetbrains.kotlin.konan.target.*
|
|
import org.jetbrains.kotlin.UtilsKt
|
|
|
|
import java.nio.file.Paths
|
|
import java.util.regex.Pattern
|
|
|
|
import static org.jetbrains.kotlin.konan.target.Architecture.*
|
|
|
|
buildscript {
|
|
repositories {
|
|
mavenCentral()
|
|
|
|
maven {
|
|
url project.bootstrapKotlinRepo
|
|
}
|
|
}
|
|
}
|
|
|
|
apply plugin: 'konan'
|
|
apply plugin: 'kotlin'
|
|
apply plugin: 'kotlin.native.build-tools-conventions'
|
|
|
|
configurations {
|
|
cli_bc
|
|
update_tests
|
|
|
|
nopPluginApi
|
|
api.extendsFrom nopPluginApi
|
|
}
|
|
|
|
dependencies {
|
|
// TODO: upgrade coroutines to common version
|
|
api DependenciesKt.commonDependency(project, "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7")
|
|
}
|
|
ext.testOutputRoot = rootProject.file("test.output").absolutePath
|
|
|
|
ext.platformManager = project.project(":kotlin-native").platformManager
|
|
ext.target = platformManager.targetManager(project.testTarget).target
|
|
|
|
ext.testLibraryDir = "${ext.testOutputRoot}/klib/platform/${project.target.name}"
|
|
|
|
// Add executor to run tests depending on a target
|
|
// NOTE: If this persists in a gradle daemon, environment update (e.g. an Xcode update) may lead to execution failures.
|
|
project.extensions.executor = ExecutorServiceKt.create(project)
|
|
|
|
ext.useCustomDist = UtilsKt.getUseCustomDist(project)
|
|
ext.kotlinNativeDist = UtilsKt.getKotlinNativeDist(project)
|
|
if (!useCustomDist) {
|
|
ext.setProperty("kotlin.native.home", kotlinNativeDist.absolutePath)
|
|
ext.setProperty("org.jetbrains.kotlin.native.home", kotlinNativeDist.absolutePath)
|
|
ext.setProperty("konan.home", kotlinNativeDist.absolutePath)
|
|
}
|
|
|
|
compileTestKotlin {
|
|
kotlinOptions {
|
|
freeCompilerArgs += "-Xskip-prerelease-check"
|
|
}
|
|
}
|
|
|
|
// Do not generate run tasks for konan built artifacts
|
|
ext.konanNoRun = true
|
|
|
|
final CacheTesting cacheTesting = CacheTestingKt.configureCacheTesting(project)
|
|
if (cacheTesting != null) {
|
|
// Check for debug build and set the -g option.
|
|
if (project.globalTestArgs.contains("-opt")) {
|
|
throw new IllegalArgumentException("Cache testing should be run with debug build. " +
|
|
"Remove -opt options from the test args")
|
|
}
|
|
if (!project.globalTestArgs.contains("-g")) {
|
|
project.globalTestArgs.add("-g")
|
|
}
|
|
|
|
// Note: can't do this in [CacheTesting.configure] since task classes aren't accessible there.
|
|
tasks.withType(KonanCompileNativeBinary.class).configureEach {
|
|
dependsOn cacheTesting.buildCacheTask
|
|
extraOpts cacheTesting.compilerArgs
|
|
}
|
|
}
|
|
|
|
// Enable two-stage test compilation if the test_two_stage property is set.
|
|
ext.twoStageEnabled = project.hasProperty("test_two_stage")
|
|
|
|
tasks.withType(KonanCompileNativeBinary.class).configureEach {
|
|
enableTwoStageCompilation = twoStageEnabled
|
|
}
|
|
|
|
ext.isExperimentalMM = !(project.globalTestArgs.contains("-memory-model") &&
|
|
project.globalTestArgs.contains("strict")) &&
|
|
project.testTarget != 'wasm32'
|
|
ext.isNoopGC = project.globalTestArgs.contains("-Xgc=noop")
|
|
ext.isAggressiveGC = project.globalTestArgs.contains("-Xbinary=gcSchedulerType=aggressive")
|
|
ext.isCmsGC = project.globalTestArgs.contains("-Xgc=cms") || !project.globalTestArgs.any { it.startsWith("-Xgc=") }
|
|
ext.runtimeAssertionsPanic = false
|
|
|
|
// TODO: It also makes sense to test -g without asserts, and also to test -opt with asserts.
|
|
if (project.globalTestArgs.contains("-g") && (cacheTesting == null)) {
|
|
tasks.withType(KonanCompileNativeBinary.class).configureEach {
|
|
extraOpts "-Xbinary=runtimeAssertionsMode=panic"
|
|
}
|
|
ext.runtimeAssertionsPanic = true
|
|
}
|
|
|
|
if (!isExperimentalMM) {
|
|
tasks.withType(KonanCompileNativeBinary.class).configureEach {
|
|
extraOpts "-opt-in=kotlin.native.FreezingIsDeprecated"
|
|
}
|
|
}
|
|
|
|
tasks.withType(KonanCompileNativeBinary).configureEach {
|
|
extraOpts "-XXLanguage:+ImplicitSignedToUnsignedIntegerConversion"
|
|
extraOpts "-opt-in=kotlinx.cinterop.ExperimentalForeignApi"
|
|
}
|
|
|
|
allprojects {
|
|
// Root directories for test output (logs, compiled files, statistics etc). Only single path must be in each set.
|
|
// backend.native/tests
|
|
ext.testOutputLocal = rootProject.file("$testOutputRoot/local")
|
|
|
|
// backend.native/tests/external
|
|
ext.testOutputExternal = rootProject.file("$testOutputRoot/external")
|
|
|
|
// backend.native/tests/stdlib_external
|
|
ext.testOutputStdlib = rootProject.file("$testOutputRoot/stdlib")
|
|
|
|
// backend.native/tests/framework
|
|
ext.testOutputFramework = rootProject.file("$testOutputRoot/framework")
|
|
|
|
// backent.native/tests/coverage
|
|
ext.testOutputCoverage = rootProject.file("$testOutputRoot/coverage")
|
|
|
|
ext.testOutputFileCheck = rootProject.file("$testOutputRoot/filecheck")
|
|
}
|
|
testOutputExternal.mkdirs()
|
|
testOutputStdlib.mkdirs()
|
|
|
|
konanArtifacts {
|
|
library('testLibrary') {
|
|
srcDir 'testLibrary'
|
|
}
|
|
library('baseTestClass', targets: [target]) {
|
|
srcFiles 'testing/library.kt'
|
|
}
|
|
UtilsKt.dependsOnDist(UtilsKt.findKonanBuildTask(project, "testLibrary", HostManager.@Companion.getHost()))
|
|
}
|
|
configure(project.tasks.findByName("compileKonanBaseTestClass${UtilsKt.getTestTargetSuffix(project)}")) {
|
|
UtilsKt.dependsOnDist(it)
|
|
}
|
|
|
|
def installTestLib = tasks.register("installTestLibrary", KonanKlibInstallTask) {
|
|
dependsOn "compileKonanTestLibraryHost"
|
|
klib = project.provider { konanArtifacts.testLibrary.getArtifactByTarget('host') }
|
|
repo = rootProject.file(testLibraryDir)
|
|
|
|
doLast {
|
|
// Remove the version in build/, so that we don't link two copies.
|
|
def file = project.file("build/konan/libs/${project.target.name}/testLibrary.klib")
|
|
file.delete()
|
|
}
|
|
}
|
|
|
|
void konanc(String[] args) {
|
|
def konancScript = isWindows() ? "konanc.bat" : "konanc"
|
|
def konanc = "$kotlinNativeDist/bin/$konancScript"
|
|
def allArgs = args.join(" ")
|
|
println("$konanc $allArgs")
|
|
"$konanc $allArgs".execute().waitFor()
|
|
}
|
|
|
|
clean {
|
|
doLast {
|
|
delete(project(":kotlin-native").file(testOutputRoot))
|
|
}
|
|
}
|
|
|
|
TaskCollection<Task> tasksOf(Class<? extends Task> type, Closure<Boolean> filter = { return true }) {
|
|
String prefix = project.findProperty("prefix")
|
|
project.tasks.withType(type)
|
|
.matching { filter(it) && it.enabled && (prefix != null ? it.name.startsWith(prefix) : true) }
|
|
}
|
|
|
|
run {
|
|
dependsOn("sanity")
|
|
// Note: sanity contains subsets of the tests listed below.
|
|
|
|
dependsOn(tasksOf(KonanTest))
|
|
// Add framework tests
|
|
dependsOn(tasksOf(FrameworkTest))
|
|
dependsOn(tasksOf(FileCheckTest))
|
|
}
|
|
|
|
task sanity {
|
|
def platformLibsTasks =":distPlatformLibs" + ":kotlin-native:platformLibs"
|
|
dependsOn(tasksOf(KonanTest) { task ->
|
|
!UtilsKt.isDependsOnPlatformLibs(task) &&
|
|
task.name != "library_mismatch" // This test requires the wasm32 stdlib which is unavailable during a sanity run.
|
|
})
|
|
// Add framework tests
|
|
dependsOn(tasksOf(FrameworkTest) { task ->
|
|
!UtilsKt.isDependsOnPlatformLibs(task)
|
|
})
|
|
// Add regular gradle test tasks
|
|
dependsOn(tasksOf(Test))
|
|
dependsOn(tasksOf(CoverageTest))
|
|
dependsOn(tasksOf(FileCheckTest) { task ->
|
|
// Avoid cross-compilation in a sanity run.
|
|
task.targetName == project.target.name
|
|
})
|
|
dependsOn(":kotlin-native:Interop:Indexer:check")
|
|
dependsOn(":kotlin-native:Interop:StubGenerator:check")
|
|
dependsOn(":native:kotlin-native-utils:check")
|
|
}
|
|
|
|
boolean isExcluded(String dir) {
|
|
// List of tests that fail due to unresolved compiler bugs
|
|
def excluded = [ ]
|
|
|
|
boolean result = false
|
|
excluded.forEach {
|
|
if (dir.endsWith(it.replace("/", File.separator))) {
|
|
result = true
|
|
}
|
|
}
|
|
return result
|
|
}
|
|
|
|
/**
|
|
* Creates a task for a standalone test. Configures runner and adds building task.
|
|
*/
|
|
Task standaloneTest(String name, Closure configureClosure) {
|
|
return KotlinNativeTestKt.createTest(project, name, KonanStandaloneTest) { task ->
|
|
task.configure(configureClosure)
|
|
if (task.enabled) {
|
|
konanArtifacts {
|
|
program(name, targets: [target.name]) {
|
|
baseDir "$testOutputLocal/$name"
|
|
srcFiles task.getSources()
|
|
extraOpts task.flags
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Creates a task for a linking test. Configures runner and adds library and test build tasks.
|
|
*/
|
|
Task linkTest(String name, Closure<KonanLinkTest> configureClosure) {
|
|
return KotlinNativeTestKt.createTest(project, name, KonanLinkTest) { task ->
|
|
task.configure(configureClosure)
|
|
if (task.enabled) {
|
|
konanArtifacts {
|
|
def lib = "lib$name"
|
|
def targetName = target.name
|
|
// build a library from KonanLinkTest::lib property
|
|
library(lib, targets: [targetName]) {
|
|
srcFiles task.lib
|
|
baseDir "$testOutputLocal/$name"
|
|
extraOpts task.flags
|
|
extraOpts project.globalTestArgs.findAll { !it.contains("-Xpartial-linkage") }
|
|
}
|
|
UtilsKt.dependsOnKonanBuildingTask(task, lib, target)
|
|
|
|
// Build an executable with library
|
|
program(name, targets: [targetName]) {
|
|
libraries {
|
|
klib lib
|
|
}
|
|
baseDir "$testOutputLocal/$name"
|
|
srcFiles task.getSources()
|
|
extraOpts task.flags
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Creates a task for a dynamic test. Configures runner and adds library and test build tasks.
|
|
*/
|
|
Task dynamicTest(String name, Closure<KonanDynamicTest> configureClosure) {
|
|
return KotlinNativeTestKt.createTest(project, name, KonanDynamicTest) { task ->
|
|
task.configure(configureClosure)
|
|
if (task.enabled) {
|
|
konanArtifacts {
|
|
def targetName = target.name
|
|
def lib = task.interop
|
|
if (lib != null) {
|
|
UtilsKt.dependsOnKonanBuildingTask(task, lib, target)
|
|
}
|
|
dynamic(name, targets: [targetName]) {
|
|
if (lib != null) {
|
|
libraries {
|
|
artifact lib
|
|
}
|
|
}
|
|
srcFiles task.getSources()
|
|
baseDir "$testOutputLocal/$name"
|
|
extraOpts task.flags
|
|
extraOpts project.globalTestArgs
|
|
if (targetName == "mingw_x64" || targetName == "mingw_x86") {
|
|
extraOpts "-linker-option", "-Wl,--out-implib,$testOutputLocal/$name/$targetName/${name}.dll.a"
|
|
}
|
|
}
|
|
}
|
|
def buildTask = UtilsKt.findKonanBuildTask(project, name, target)
|
|
UtilsKt.dependsOnDist(buildTask)
|
|
}
|
|
}
|
|
}
|
|
|
|
linkTest("localDelegatedPropertyLink") {
|
|
source = "lower/local_delegated_property_link/main.kt"
|
|
lib = "lower/local_delegated_property_link/lib.kt"
|
|
}
|
|
|
|
task sum(type: KonanLocalTest) {
|
|
source = "codegen/function/sum.kt"
|
|
}
|
|
|
|
task method_call(type: KonanLocalTest) {
|
|
source = "codegen/object/method_call.kt"
|
|
}
|
|
|
|
task fields(type: KonanLocalTest) {
|
|
source = "codegen/object/fields.kt"
|
|
}
|
|
|
|
task fields1(type: KonanLocalTest) {
|
|
source = "codegen/object/fields1.kt"
|
|
}
|
|
|
|
task fields2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/object/fields2.kt"
|
|
}
|
|
|
|
// This test checks object layout can't be done in
|
|
// KonanLocalTest paradigm
|
|
//task constructor(type: UnitKonanTest) {
|
|
// source = "codegen/object/constructor.kt"
|
|
//}
|
|
|
|
task objectInitialization(type: KonanLocalTest) {
|
|
source = "codegen/object/initialization.kt"
|
|
}
|
|
|
|
task objectInitialization1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/object/initialization1.kt"
|
|
}
|
|
|
|
standaloneTest("object_globalInitializer") {
|
|
source = "codegen/object/globalInitializer.kt"
|
|
}
|
|
|
|
task check_type(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/check_type.kt"
|
|
}
|
|
|
|
task safe_cast(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/safe_cast.kt"
|
|
}
|
|
|
|
task typealias1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/typealias1.kt"
|
|
}
|
|
|
|
task aritmetic(type: KonanLocalTest) {
|
|
source = "codegen/function/arithmetic.kt"
|
|
}
|
|
|
|
task sum1(type: KonanLocalTest) {
|
|
source = "codegen/function/sum_foo_bar.kt"
|
|
}
|
|
|
|
task sum2(type: KonanLocalTest) {
|
|
source = "codegen/function/sum_imm.kt"
|
|
}
|
|
|
|
task sum_func(type: KonanLocalTest) {
|
|
source = "codegen/function/sum_func.kt"
|
|
}
|
|
|
|
task sum_mixed(type: KonanLocalTest) {
|
|
source = "codegen/function/sum_mixed.kt"
|
|
}
|
|
|
|
task sum_illy(type: KonanLocalTest) {
|
|
source = "codegen/function/sum_silly.kt"
|
|
}
|
|
|
|
task function_defaults(type: KonanLocalTest) {
|
|
source = "codegen/function/defaults.kt"
|
|
}
|
|
|
|
task function_defaults1(type: KonanLocalTest) {
|
|
source = "codegen/function/defaults1.kt"
|
|
}
|
|
|
|
task function_defaults2(type: KonanLocalTest) {
|
|
source = "codegen/function/defaults2.kt"
|
|
}
|
|
|
|
task function_defaults3(type: KonanLocalTest) {
|
|
source = "codegen/function/defaults3.kt"
|
|
}
|
|
|
|
task function_defaults4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaults4.kt"
|
|
}
|
|
|
|
task function_defaults5(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaults5.kt"
|
|
}
|
|
|
|
task function_defaults6(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaults6.kt"
|
|
}
|
|
|
|
task function_defaults7(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaults7.kt"
|
|
}
|
|
|
|
task function_defaults8(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaults8.kt"
|
|
}
|
|
|
|
task function_defaults9(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaults9.kt"
|
|
}
|
|
|
|
task function_defaults10(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaults10.kt"
|
|
}
|
|
|
|
task function_defaults_from_fake_override(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaultsFromFakeOverride.kt"
|
|
}
|
|
|
|
task function_defaults_with_vararg1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaultsWithVarArg1.kt"
|
|
}
|
|
|
|
task function_defaults_with_vararg2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/defaultsWithVarArg2.kt"
|
|
}
|
|
|
|
task function_defaults_with_inline_classes(type: KonanLocalTest) {
|
|
source = "codegen/function/defaultsWithInlineClasses.kt"
|
|
}
|
|
|
|
task sum_3const(type: KonanLocalTest) {
|
|
source = "codegen/function/sum_3const.kt"
|
|
}
|
|
|
|
standaloneTest("function_nothingN_returning_safe_call") {
|
|
flags = ["-g", "-entry", "codegen.function.nothingN_returning_safe_call.main"]
|
|
source = "codegen/function/nothingNReturningSafeCall.kt"
|
|
}
|
|
|
|
standaloneTest("unreachable_statement_after_return") {
|
|
flags = ["-g", "-entry", "codegen.function.unreachable_statement_after_return.main"]
|
|
source = "codegen/function/unreachableStatementAfterReturn.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_types(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_types.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_overflow(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_overflow.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_errors(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
source = "codegen/controlflow/for_loops_errors.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_empty_range(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_empty_range.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_nested(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_nested.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_coroutines(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_coroutines.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_let_with_nullable(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_let_with_nullable.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_call_order(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_call_order.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_array_indices(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_array_indices.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_array(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_array.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_array_nested(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_array_nested.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_array_side_effects(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_array_side_effects.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_array_break_continue(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_array_break_continue.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_array_mutation(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_array_mutation.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task codegen_controlflow_for_loops_array_nullable(type: KonanLocalTest) {
|
|
source = "codegen/controlflow/for_loops_array_nullable.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task local_variable(type: KonanLocalTest) {
|
|
source = "codegen/basics/local_variable.kt"
|
|
}
|
|
|
|
task canonical_name(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/canonical_name.kt"
|
|
}
|
|
|
|
task cast_simple(type: KonanLocalTest) {
|
|
source = "codegen/basics/cast_simple.kt"
|
|
}
|
|
|
|
task cast_null(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/basics/cast_null.kt"
|
|
}
|
|
|
|
task unchecked_cast1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/unchecked_cast1.kt"
|
|
}
|
|
|
|
task unchecked_cast2(type: KonanLocalTest) {
|
|
enabled = false
|
|
useGoldenData = true
|
|
source = "codegen/basics/unchecked_cast2.kt"
|
|
}
|
|
|
|
task unchecked_cast3(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/basics/unchecked_cast3.kt"
|
|
}
|
|
|
|
task unchecked_cast4(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/basics/unchecked_cast4.kt"
|
|
}
|
|
|
|
task null_check(type: KonanLocalTest) {
|
|
source = "codegen/basics/null_check.kt"
|
|
}
|
|
|
|
task array_to_any(type: KonanLocalTest) {
|
|
source = "codegen/basics/array_to_any.kt"
|
|
}
|
|
|
|
standaloneTest("runtime_basic_init") {
|
|
source = "runtime/basic/init.kt"
|
|
expectedExitStatus = 0
|
|
}
|
|
|
|
standaloneTest("runtime_basic_exit") {
|
|
source = "runtime/basic/exit.kt"
|
|
expectedExitStatus = 42
|
|
}
|
|
|
|
task runtime_random(type: KonanLocalTest) {
|
|
source = "runtime/basic/random.kt"
|
|
}
|
|
|
|
task runtime_basic_simd(type: KonanLocalTest) {
|
|
disabled = (project.testTarget == 'linux_mips32')
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "runtime/basic/simd.kt"
|
|
}
|
|
|
|
task runtime_worker_random(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Uses workers.
|
|
source = "runtime/basic/worker_random.kt"
|
|
}
|
|
|
|
task hello0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/hello0.kt"
|
|
}
|
|
|
|
task stringTrim(type: KonanLocalTest) {
|
|
source = "codegen/stringTrim/stringTrim.kt"
|
|
}
|
|
|
|
standaloneTest("hello1") {
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/hello1.kt"
|
|
}
|
|
|
|
standaloneTest("hello2") {
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/hello2.kt"
|
|
}
|
|
|
|
standaloneTest("readlnOrNull_empty") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-48738
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readlnOrNull_empty.kt"
|
|
}
|
|
|
|
standaloneTest("readln_empty") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-48738
|
|
useTestData = true
|
|
outputChecker = { s -> s.contains("ReadAfterEOFException") }
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/basic/readln_empty.kt"
|
|
}
|
|
|
|
standaloneTest("readln_alone_CR") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-48738
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readln_alone_CR.kt"
|
|
}
|
|
|
|
standaloneTest("readln_empty_new_line") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-48738
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readln_empty_new_line.kt"
|
|
}
|
|
|
|
standaloneTest("readln_multiline") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-48738
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readln_multiline.kt"
|
|
}
|
|
|
|
standaloneTest("readln_CR_and_CRLF") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-48738
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readln_CR_and_CRLF.kt"
|
|
}
|
|
|
|
standaloneTest("readln_long_line") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-48738
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readln_long_line.kt"
|
|
}
|
|
|
|
standaloneTest("readln_cyrillic") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-48738
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readln_cyrillic.kt"
|
|
}
|
|
|
|
standaloneTest("readln_multiple_empty_new_lines") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-48738
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readln_multiple_empty_new_lines.kt"
|
|
}
|
|
|
|
task hello3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/hello3.kt"
|
|
}
|
|
|
|
task hello4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/hello4.kt"
|
|
}
|
|
|
|
standaloneTest('enumEquals') {
|
|
useGoldenData = true
|
|
source = "runtime/basic/enum_equals.kt"
|
|
flags = ['-XXLanguage:-ProhibitComparisonOfIncompatibleEnums', '-e', 'runtime.basic.enum_equals.main']
|
|
}
|
|
|
|
standaloneTest("entry0") {
|
|
useGoldenData = true
|
|
source = "runtime/basic/entry0.kt"
|
|
flags = ["-entry", "runtime.basic.entry0.main"]
|
|
}
|
|
|
|
standaloneTest("entry1") {
|
|
useGoldenData = true
|
|
source = "runtime/basic/entry1.kt"
|
|
flags = ["-entry", "foo"]
|
|
}
|
|
|
|
linkTest("entry2") {
|
|
useGoldenData = true
|
|
source = "runtime/basic/entry2.kt"
|
|
lib = "runtime/basic/libentry2.kt"
|
|
flags = ["-entry", "foo"]
|
|
}
|
|
|
|
standaloneTest("entry3") {
|
|
useGoldenData = true
|
|
source = "runtime/basic/entry3.kt"
|
|
flags = ["-entry", "bar"]
|
|
}
|
|
|
|
standaloneTest("entry4") {
|
|
useGoldenData = true
|
|
source = "runtime/basic/entry4.kt"
|
|
}
|
|
|
|
standaloneTest("readline0") {
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readline0.kt"
|
|
}
|
|
|
|
standaloneTest("readline1") {
|
|
useGoldenData = true
|
|
useTestData = true
|
|
source = "runtime/basic/readline1.kt"
|
|
}
|
|
|
|
task tostring0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/tostring0.kt"
|
|
}
|
|
|
|
task tostring1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/tostring1.kt"
|
|
}
|
|
|
|
task tostring2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/tostring2.kt"
|
|
}
|
|
|
|
task tostring3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/tostring3.kt"
|
|
}
|
|
|
|
task tostring4(type: KonanLocalTest) {
|
|
source = "runtime/basic/tostring4.kt"
|
|
}
|
|
|
|
task empty_substring(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/empty_substring.kt"
|
|
}
|
|
|
|
standaloneTest("cleaner_basic") {
|
|
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
|
!isNoopGC
|
|
source = "runtime/basic/cleaner_basic.kt"
|
|
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
standaloneTest("collect_reference_field_values") {
|
|
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
|
!isNoopGC
|
|
source = "runtime/basic/collectReferenceFieldValues.kt"
|
|
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
standaloneTest("cleaner_workers") {
|
|
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
|
!isNoopGC
|
|
source = "runtime/basic/cleaner_workers.kt"
|
|
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
standaloneTest("cleaner_in_main_with_checker") {
|
|
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
|
!isNoopGC
|
|
source = "runtime/basic/cleaner_in_main_with_checker.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("cleaner_in_main_without_checker") {
|
|
enabled = (project.testTarget != 'wasm32') // Cleaners need workers
|
|
source = "runtime/basic/cleaner_in_main_without_checker.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("cleaner_leak_without_checker") {
|
|
enabled = (project.testTarget != 'wasm32') // Cleaners need workers
|
|
source = "runtime/basic/cleaner_leak_without_checker.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("cleaner_leak_with_checker") {
|
|
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
|
!isNoopGC
|
|
source = "runtime/basic/cleaner_leak_with_checker.kt"
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> (s =~ /Cleaner (0x)?[0-9a-fA-F]+ was disposed during program exit/).find() }
|
|
}
|
|
|
|
standaloneTest("cleaner_in_tls_main_without_checker") {
|
|
enabled = (project.testTarget != 'wasm32') // Cleaners need workers
|
|
source = "runtime/basic/cleaner_in_tls_main_without_checker.kt"
|
|
}
|
|
|
|
standaloneTest("cleaner_in_tls_main_with_checker") {
|
|
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
|
!isNoopGC
|
|
source = "runtime/basic/cleaner_in_tls_main_with_checker.kt"
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> (s =~ /Cleaner (0x)?[0-9a-fA-F]+ was disposed during program exit/).find() }
|
|
}
|
|
|
|
standaloneTest("cleaner_in_tls_worker") {
|
|
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
|
|
!isNoopGC
|
|
source = "runtime/basic/cleaner_in_tls_worker.kt"
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
standaloneTest("worker_bound_reference0") {
|
|
enabled = (project.testTarget != 'wasm32') && // Workers need pthreads.
|
|
!isK2(project) // KT-56272
|
|
source = "runtime/concurrent/worker_bound_reference0.kt"
|
|
flags = ['-tr']
|
|
|
|
if (isNoopGC) {
|
|
def exclude = [
|
|
"*.testCollect",
|
|
"*.testCollectFrozen",
|
|
"*.testCollectInWorkerFrozen",
|
|
"*.collectCyclicGarbage",
|
|
"*.collectCyclicGarbageWithAtomicsFrozen",
|
|
"*.collectCrossThreadCyclicGarbageWithAtomicsFrozen"
|
|
]
|
|
arguments += ["--ktest_filter=*-${exclude.join(":")}"]
|
|
}
|
|
}
|
|
|
|
task worker0(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker0.kt"
|
|
}
|
|
|
|
task worker1(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker1.kt"
|
|
}
|
|
|
|
task worker2(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker2.kt"
|
|
}
|
|
|
|
task worker3(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker3.kt"
|
|
}
|
|
|
|
task worker4(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker4.kt"
|
|
}
|
|
|
|
// This tests changes main thread worker queue state, so better be executed alone.
|
|
standaloneTest("worker5") {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker5.kt"
|
|
}
|
|
|
|
task worker6(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker6.kt"
|
|
}
|
|
|
|
task worker7(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker7.kt"
|
|
}
|
|
|
|
task worker8(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker8.kt"
|
|
}
|
|
|
|
task worker9(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') && // Workers need pthreads.
|
|
!isExperimentalMM
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker9.kt"
|
|
}
|
|
|
|
task worker9_experimentalMM(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') && // Workers need pthreads.
|
|
isExperimentalMM
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker9_experimentalMM.kt"
|
|
}
|
|
|
|
task worker10(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') && // Workers need pthreads.
|
|
!isNoopGC
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker10.kt"
|
|
}
|
|
|
|
task worker11(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
&& !isAggressiveGC // TODO: Investigate why too slow
|
|
useGoldenData = true
|
|
source = "runtime/workers/worker11.kt"
|
|
}
|
|
|
|
task worker_exception_messages(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
source = "runtime/workers/worker_exception_messages.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions") {
|
|
flags = ["-tr", "-Xworker-exception-handling=use-hook"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
outputChecker = {
|
|
!it.contains("testExecuteAfterStartQuiet error") && it.contains("testExecuteStart error") && !it.contains("testExecuteStartQuiet error")
|
|
}
|
|
source = "runtime/workers/worker_exceptions.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions_legacy") {
|
|
flags = ["-tr", "-Xworker-exception-handling=legacy"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
outputChecker = {
|
|
it.contains("testExecuteAfterStartLegacy error") && it.contains("testExecuteStartLegacy error")
|
|
}
|
|
source = "runtime/workers/worker_exceptions_legacy.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions_terminate") {
|
|
flags = ["-Xworker-exception-handling=use-hook"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = {
|
|
it.contains("some error") && !it.contains("Will not happen")
|
|
}
|
|
source = "runtime/workers/worker_exceptions_terminate.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions_terminate_legacy") {
|
|
flags = ["-Xworker-exception-handling=legacy"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
outputChecker = {
|
|
it.contains("some error") && it.contains("Will not happen")
|
|
}
|
|
source = "runtime/workers/worker_exceptions_terminate.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions_terminate_hook") {
|
|
flags = ["-Xworker-exception-handling=use-hook"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
outputChecker = {
|
|
it.contains("hook called") && !it.contains("some error") && it.contains("Will happen")
|
|
}
|
|
source = "runtime/workers/worker_exceptions_terminate_hook.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions_terminate_hook_legacy") {
|
|
flags = ["-Xworker-exception-handling=legacy"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
outputChecker = {
|
|
!it.contains("hook called") && it.contains("some error") && it.contains("Will happen")
|
|
}
|
|
source = "runtime/workers/worker_exceptions_terminate_hook.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions_terminate_current") {
|
|
flags = ["-Xworker-exception-handling=use-hook"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = {
|
|
it.contains("some error") && !it.contains("Will not happen")
|
|
}
|
|
source = "runtime/workers/worker_exceptions_terminate_current.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions_terminate_current_legacy") {
|
|
flags = ["-Xworker-exception-handling=legacy"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
outputChecker = {
|
|
it.contains("some error") && it.contains("Will not happen")
|
|
}
|
|
source = "runtime/workers/worker_exceptions_terminate_current.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions_terminate_hook_current") {
|
|
flags = ["-Xworker-exception-handling=use-hook"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
outputChecker = {
|
|
it.contains("hook called") && !it.contains("some error") && it.contains("Will happen")
|
|
}
|
|
source = "runtime/workers/worker_exceptions_terminate_hook_current.kt"
|
|
}
|
|
|
|
standaloneTest("worker_exceptions_terminate_hook_current_legacy") {
|
|
flags = ["-Xworker-exception-handling=legacy"]
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
outputChecker = {
|
|
!it.contains("hook called") && it.contains("some error") && it.contains("Will happen")
|
|
}
|
|
source = "runtime/workers/worker_exceptions_terminate_hook_current.kt"
|
|
}
|
|
|
|
standaloneTest("worker_threadlocal_no_leak") {
|
|
disabled = (project.testTarget == 'wasm32') // Needs pthreads.
|
|
source = "runtime/workers/worker_threadlocal_no_leak.kt"
|
|
}
|
|
|
|
task worker_list_workers(type: KonanLocalTest) {
|
|
disabled = (project.testTarget == 'wasm32') // Needs pthreads.
|
|
source = "runtime/workers/worker_list_workers.kt"
|
|
}
|
|
|
|
standaloneTest("freeze0") {
|
|
enabled = (project.testTarget != 'wasm32') && (cacheTesting == null) // No workers on WASM.
|
|
useGoldenData = true
|
|
flags = ["-Xbinary=freezing=full", "-tr"]
|
|
source = "runtime/workers/freeze0.kt"
|
|
testLogger = KonanTest.Logger.SILENT
|
|
}
|
|
|
|
standaloneTest("freeze1") {
|
|
enabled = (project.testTarget != 'wasm32') && (cacheTesting == null) // No exceptions on WASM.
|
|
useGoldenData = true
|
|
flags = ["-Xbinary=freezing=full", "-tr"]
|
|
source = "runtime/workers/freeze1.kt"
|
|
testLogger = KonanTest.Logger.SILENT
|
|
}
|
|
|
|
standaloneTest("freeze_stress") {
|
|
enabled = (project.testTarget != 'wasm32') && (cacheTesting == null) // No exceptions on WASM.
|
|
&& !isAggressiveGC // TODO: Investigate why too slow
|
|
useGoldenData = true
|
|
flags = ["-Xbinary=freezing=full", "-tr"]
|
|
source = "runtime/workers/freeze_stress.kt"
|
|
testLogger = KonanTest.Logger.SILENT
|
|
}
|
|
|
|
standaloneTest("freeze2") {
|
|
enabled = (project.testTarget != 'wasm32') && (cacheTesting == null) // No exceptions on WASM.
|
|
useGoldenData = true
|
|
flags = ["-Xbinary=freezing=full", "-tr"]
|
|
source = "runtime/workers/freeze2.kt"
|
|
testLogger = KonanTest.Logger.SILENT
|
|
}
|
|
|
|
standaloneTest("freeze3") {
|
|
enabled = (project.testTarget != 'wasm32') && (cacheTesting == null) // No exceptions on WASM.
|
|
useGoldenData = true
|
|
flags = ["-Xbinary=freezing=full", "-tr"]
|
|
source = "runtime/workers/freeze3.kt"
|
|
testLogger = KonanTest.Logger.SILENT
|
|
}
|
|
|
|
standaloneTest("freeze4") {
|
|
enabled = (project.testTarget != 'wasm32') && (cacheTesting == null) // No exceptions on WASM.
|
|
useGoldenData = true
|
|
flags = ["-Xbinary=freezing=full", "-tr"]
|
|
source = "runtime/workers/freeze4.kt"
|
|
testLogger = KonanTest.Logger.SILENT
|
|
}
|
|
|
|
standaloneTest("freeze5") {
|
|
enabled = cacheTesting == null
|
|
useGoldenData = true
|
|
flags = ["-Xbinary=freezing=full", "-tr"]
|
|
source = "runtime/workers/freeze5.kt"
|
|
testLogger = KonanTest.Logger.SILENT
|
|
}
|
|
|
|
standaloneTest("freeze6") {
|
|
enabled = (project.testTarget != 'wasm32') && (cacheTesting == null) // No exceptions on WASM.
|
|
&& !isNoopGC
|
|
useGoldenData = true
|
|
flags = ["-Xbinary=freezing=full", "-tr"]
|
|
source = "runtime/workers/freeze6.kt"
|
|
testLogger = KonanTest.Logger.SILENT
|
|
}
|
|
|
|
standaloneTest("freeze_disabled") {
|
|
enabled = (project.testTarget != 'wasm32') && // No exceptions on WASM.
|
|
!isNoopGC && isExperimentalMM
|
|
flags = ["-tr"]
|
|
source = "runtime/workers/freeze_disabled.kt"
|
|
testLogger = KonanTest.Logger.SILENT
|
|
}
|
|
|
|
task atomicSmokeTest(type: KonanLocalTest) {
|
|
enabled = isExperimentalMM // do not run the test on the legacy MM
|
|
source = "runtime/atomics/atomic_smoke.kt"
|
|
}
|
|
|
|
task atomicStressTest(type: KonanLocalTest) {
|
|
enabled = isExperimentalMM // do not run the test on the legacy MM
|
|
source = "runtime/atomics/atomic_stress.kt"
|
|
}
|
|
|
|
task atomic0(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/atomics/atomic0.kt"
|
|
}
|
|
|
|
standaloneTest("atomic1") {
|
|
// Note: This test reproduces a race, so it'll start flaking if problem is reintroduced.
|
|
enabled = false // Needs USE_CYCLIC_GC, which is disabled.
|
|
source = "runtime/atomics/atomic1.kt"
|
|
}
|
|
|
|
task lazy0(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/lazy0.kt"
|
|
}
|
|
|
|
task lazy1(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Need exceptions.
|
|
useGoldenData = true
|
|
source = "runtime/workers/lazy1.kt"
|
|
}
|
|
|
|
standaloneTest("lazy2") {
|
|
useGoldenData = true
|
|
source = "runtime/workers/lazy2.kt"
|
|
}
|
|
|
|
standaloneTest("lazy3") {
|
|
enabled = !isNoopGC
|
|
source = "runtime/workers/lazy3.kt"
|
|
}
|
|
|
|
task lazy4(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads. Need exceptions
|
|
&& !isAggressiveGC // TODO: Investigate why too slow
|
|
source = "runtime/workers/lazy4.kt"
|
|
}
|
|
|
|
task mutableData1(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads. Need exceptions
|
|
source = "runtime/workers/mutableData1.kt"
|
|
}
|
|
|
|
task enumIdentity(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Workers need pthreads.
|
|
useGoldenData = true
|
|
source = "runtime/workers/enum_identity.kt"
|
|
}
|
|
|
|
standaloneTest("leakWorker") {
|
|
disabled = (project.testTarget == 'wasm32') // Needs pthreads.
|
|
source = "runtime/workers/leak_worker.kt"
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> s.contains("Unfinished workers detected, 1 workers leaked!") }
|
|
}
|
|
|
|
standaloneTest("leakMemoryWithWorkerTermination") {
|
|
disabled = (project.testTarget == 'wasm32') // Needs pthreads.
|
|
source = "runtime/workers/leak_memory_with_worker_termination.kt"
|
|
|
|
if (!isExperimentalMM) { // Experimental MM will not report memory leaks.
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> s.contains("Memory leaks detected, 1 objects leaked!") }
|
|
}
|
|
}
|
|
|
|
task superFunCall(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/superFunCall.kt"
|
|
}
|
|
|
|
task superGetterCall(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/superGetterCall.kt"
|
|
}
|
|
|
|
task superSetterCall(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/superSetterCall.kt"
|
|
}
|
|
|
|
task enum0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/test0.kt"
|
|
}
|
|
|
|
task enum1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/test1.kt"
|
|
}
|
|
|
|
task enum_valueOf(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/valueOf.kt"
|
|
}
|
|
|
|
task enum_values(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/values.kt"
|
|
}
|
|
|
|
task enum_vCallNoEntryClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/vCallNoEntryClass.kt"
|
|
}
|
|
|
|
task enum_vCallWithEntryClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/vCallWithEntryClass.kt"
|
|
}
|
|
|
|
task enum_companionObject(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/companionObject.kt"
|
|
}
|
|
|
|
task enum_interfaceCallNoEntryClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/interfaceCallNoEntryClass.kt"
|
|
}
|
|
|
|
task enum_interfaceCallWithEntryClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/interfaceCallWithEntryClass.kt"
|
|
}
|
|
|
|
linkTest("enum_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/enum/linkTest_main.kt"
|
|
lib = "codegen/enum/linkTest_lib.kt"
|
|
}
|
|
|
|
linkTest("enum_openMethodNoOverrides") {
|
|
useGoldenData = true
|
|
source = "codegen/enum/openMethodNoOverrides_main.kt"
|
|
lib = "codegen/enum/openMethodNoOverrides_lib.kt"
|
|
}
|
|
|
|
task enum_varargParam(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/varargParam.kt"
|
|
}
|
|
|
|
task enum_nested(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/nested.kt"
|
|
}
|
|
|
|
task enum_isFrozen(type: KonanLocalTest) {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "codegen/enum/isFrozen.kt"
|
|
}
|
|
|
|
task enum_loop(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/loop.kt"
|
|
}
|
|
|
|
task enum_reorderedArguments(type: KonanLocalTest) {
|
|
source = "codegen/enum/reorderedArguments.kt"
|
|
}
|
|
|
|
standaloneTest('switchLowering') {
|
|
useGoldenData = true
|
|
source = "codegen/enum/switchLowering.kt"
|
|
flags = ['-XXLanguage:-ProhibitComparisonOfIncompatibleEnums', '-e', 'codegen.enum.switchLowering.main']
|
|
}
|
|
|
|
task enum_lambdaInDefault(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/enum/lambdaInDefault.kt"
|
|
}
|
|
|
|
linkTest("mangling") {
|
|
useGoldenData = true
|
|
source = "mangling/mangling.kt"
|
|
lib = "mangling/manglinglib.kt"
|
|
}
|
|
|
|
task innerClass_simple(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/simple.kt"
|
|
}
|
|
|
|
task innerClass_getOuterVal(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/getOuterVal.kt"
|
|
}
|
|
|
|
task innerClass_generic(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/generic.kt"
|
|
}
|
|
|
|
task innerClass_doubleInner(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/doubleInner.kt"
|
|
}
|
|
|
|
task innerClass_qualifiedThis(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/qualifiedThis.kt"
|
|
}
|
|
|
|
task innerClass_superOuter(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/superOuter.kt"
|
|
}
|
|
|
|
task innerClass_noPrimaryConstructor(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/noPrimaryConstructor.kt"
|
|
}
|
|
|
|
task innerClass_secondaryConstructor(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/secondaryConstructor.kt"
|
|
}
|
|
|
|
linkTest("innerClass_linkTest") {
|
|
source = "codegen/innerClass/linkTest_main.kt"
|
|
lib = "codegen/innerClass/linkTest_lib.kt"
|
|
}
|
|
|
|
linkTest("innerClass_inheritance_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/inheritance_linkTest_main.kt"
|
|
lib = "codegen/innerClass/inheritance_linkTest_lib.kt"
|
|
}
|
|
|
|
linkTest("innerClass_inheritance2_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/inheritance2_linkTest_main.kt"
|
|
lib = "codegen/innerClass/inheritance2_linkTest_lib.kt"
|
|
}
|
|
|
|
linkTest("innerClass_inheritance3_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/innerClass/inheritance3_linkTest_main.kt"
|
|
lib = "codegen/innerClass/inheritance3_linkTest_lib.kt"
|
|
}
|
|
|
|
task localClass_localHierarchy(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/localHierarchy.kt"
|
|
}
|
|
|
|
standaloneTest("objectDeclaration_globalConstants") {
|
|
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
|
|
flags = ["-opt", "-opt-in=kotlin.native.internal.InternalForKotlinNative", "-tr"]
|
|
source = "codegen/objectDeclaration/globalConstants.kt"
|
|
}
|
|
|
|
task object_isFrozen(type: KonanLocalTest) {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "codegen/objectDeclaration/isFrozen.kt"
|
|
}
|
|
|
|
task localClass_objectExpressionInProperty(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/objectExpressionInProperty.kt"
|
|
}
|
|
|
|
task localClass_objectExpressionInInitializer(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/objectExpressionInInitializer.kt"
|
|
}
|
|
|
|
task localClass_innerWithCapture(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/innerWithCapture.kt"
|
|
}
|
|
|
|
task localClass_innerTakesCapturedFromOuter(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/innerTakesCapturedFromOuter.kt"
|
|
}
|
|
|
|
task localClass_virtualCallFromConstructor(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/virtualCallFromConstructor.kt"
|
|
}
|
|
|
|
task localClass_noPrimaryConstructor(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/noPrimaryConstructor.kt"
|
|
}
|
|
|
|
task localClass_localFunctionCallFromLocalClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/localFunctionCallFromLocalClass.kt"
|
|
}
|
|
|
|
task localClass_localFunctionInLocalClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/localFunctionInLocalClass.kt"
|
|
}
|
|
|
|
task localClass_tryCatch(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/localClass/tryCatch.kt"
|
|
}
|
|
|
|
task function_localFunction(type : KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/localFunction.kt"
|
|
}
|
|
|
|
task function_localFunction2(type : KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/localFunction2.kt"
|
|
}
|
|
|
|
task function_localFunction3(type : KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/localFunction3.kt"
|
|
}
|
|
|
|
task initializers_correctOrder1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/initializers/correctOrder1.kt"
|
|
}
|
|
|
|
task initializers_correctOrder2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/initializers/correctOrder2.kt"
|
|
}
|
|
|
|
standaloneTest("initializers_correctOrder3") {
|
|
source = "codegen/initializers/correctOrder3.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_globalInitedAfterAccessingFile") {
|
|
source = "codegen/initializers/globalInitedAfterAccessingFile.kt"
|
|
}
|
|
|
|
standaloneTest("initializers_globalNotInitedAfterAccessingClassInternals") {
|
|
enabled = project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM
|
|
source = "codegen/initializers/globalNotInitedAfterAccessingClassInternals.kt"
|
|
}
|
|
|
|
standaloneTest("initializers_globalInitedBeforeThreadLocal") {
|
|
source = "codegen/initializers/globalInitedBeforeThreadLocal.kt"
|
|
}
|
|
|
|
standaloneTest("initializers_eagerInitializationGlobal1") {
|
|
enabled = project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM
|
|
source = "codegen/initializers/eagerInitializationGlobal1.kt"
|
|
}
|
|
|
|
standaloneTest("initializers_eagerInitializationGlobal2") {
|
|
enabled = project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM
|
|
source = "codegen/initializers/eagerInitializationGlobal2.kt"
|
|
}
|
|
|
|
standaloneTest("initializers_eagerInitializationThreadLocal1") {
|
|
enabled = project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM
|
|
source = "codegen/initializers/eagerInitializationThreadLocal1.kt"
|
|
}
|
|
|
|
standaloneTest("initializers_eagerInitializationThreadLocal2") {
|
|
enabled = project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM
|
|
source = "codegen/initializers/eagerInitializationThreadLocal2.kt"
|
|
}
|
|
|
|
standaloneTest("initializers_testInfrastructure") {
|
|
enabled = project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM
|
|
source = "codegen/initializers/testInfrastructure.kt"
|
|
flags = ["-tr"]
|
|
}
|
|
|
|
standaloneTest("initializers_workers1") {
|
|
expectedFail = (project.testTarget == 'wasm32') // Workers are not supported
|
|
source = "codegen/initializers/workers1.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_workers2") {
|
|
expectedFail = (project.testTarget == 'wasm32') // Workers are not supported
|
|
source = "codegen/initializers/workers2.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_when1") {
|
|
source = "codegen/initializers/when1.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_when2") {
|
|
source = "codegen/initializers/when2.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_throw1") {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "codegen/initializers/throw1.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_throw2") {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "codegen/initializers/throw2.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_while1") {
|
|
source = "codegen/initializers/while1.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_while2") {
|
|
source = "codegen/initializers/while2.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_while3") {
|
|
source = "codegen/initializers/while3.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_return1") {
|
|
source = "codegen/initializers/return1.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_return2") {
|
|
source = "codegen/initializers/return2.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("initializers_object") {
|
|
source = "codegen/initializers/object.kt"
|
|
flags = ['-Xir-property-lazy-initialization=enable']
|
|
}
|
|
|
|
linkTest("initializers_linkTest1") {
|
|
useGoldenData = true
|
|
source = "codegen/initializers/linkTest1_main.kt"
|
|
lib = "codegen/initializers/linkTest1_lib.kt"
|
|
}
|
|
|
|
linkTest("initializers_linkTest2") {
|
|
useGoldenData = true
|
|
source = "codegen/initializers/linkTest2_main.kt"
|
|
lib = "codegen/initializers/linkTest2_lib.kt"
|
|
}
|
|
|
|
linkTest("initializers_sharedVarInInitBlock") {
|
|
source = "codegen/initializers/sharedVarInInitBlock_main.kt"
|
|
lib = "codegen/initializers/sharedVarInInitBlock_lib.kt"
|
|
}
|
|
|
|
standaloneTest("initializers_static") {
|
|
source = "codegen/initializers/static.kt"
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative', "-tr"]
|
|
}
|
|
|
|
task arithmetic_basic(type: KonanLocalTest) {
|
|
source = "codegen/arithmetic/basic.kt"
|
|
}
|
|
|
|
task arithmetic_division(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "codegen/arithmetic/division.kt"
|
|
}
|
|
|
|
task arithmetic_github1856(type: KonanLocalTest) {
|
|
source = "codegen/arithmetic/github1856.kt"
|
|
}
|
|
|
|
task bridges_test0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test0.kt"
|
|
}
|
|
|
|
task bridges_test1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test1.kt"
|
|
}
|
|
|
|
task bridges_test2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test2.kt"
|
|
}
|
|
|
|
task bridges_test3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test3.kt"
|
|
}
|
|
|
|
task bridges_test4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test4.kt"
|
|
}
|
|
|
|
task bridges_test5(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test5.kt"
|
|
}
|
|
|
|
task bridges_test6(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test6.kt"
|
|
}
|
|
|
|
task bridges_test7(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test7.kt"
|
|
}
|
|
|
|
task bridges_test8(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test8.kt"
|
|
}
|
|
|
|
task bridges_test9(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test9.kt"
|
|
}
|
|
|
|
task bridges_test10(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test10.kt"
|
|
}
|
|
|
|
task bridges_test11(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test11.kt"
|
|
}
|
|
|
|
task bridges_test12(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test12.kt"
|
|
}
|
|
|
|
task bridges_test13(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test13.kt"
|
|
}
|
|
|
|
task bridges_test14(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test14.kt"
|
|
}
|
|
|
|
task bridges_test15(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test15.kt"
|
|
}
|
|
|
|
task bridges_test16(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test16.kt"
|
|
}
|
|
|
|
task bridges_test17(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test17.kt"
|
|
}
|
|
|
|
task bridges_test18(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/test18.kt"
|
|
}
|
|
|
|
linkTest("bridges_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/linkTest_main.kt"
|
|
lib = "codegen/bridges/linkTest_lib.kt"
|
|
}
|
|
|
|
linkTest("bridges_linkTest2") {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/linkTest2_main.kt"
|
|
lib = "codegen/bridges/linkTest2_lib.kt"
|
|
}
|
|
|
|
task bridges_special(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/bridges/special.kt"
|
|
}
|
|
|
|
task bridges_specialGeneric(type: KonanLocalTest) {
|
|
source = "codegen/bridges/specialGeneric.kt"
|
|
}
|
|
|
|
task bridges_nativePointed(type: KonanLocalTest) {
|
|
source = "codegen/bridges/nativePointed.kt"
|
|
}
|
|
|
|
task returnTypeSignature(type: KonanLocalTest) {
|
|
source = "codegen/bridges/returnTypeSignature.kt"
|
|
}
|
|
|
|
task classDelegation_method(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/classDelegation/method.kt"
|
|
}
|
|
|
|
task classDelegation_property(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/classDelegation/property.kt"
|
|
}
|
|
|
|
task classDelegation_generic(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/classDelegation/generic.kt"
|
|
}
|
|
|
|
task classDelegation_withBridge(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/classDelegation/withBridge.kt"
|
|
}
|
|
|
|
linkTest("classDelegation_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/classDelegation/linkTest_main.kt"
|
|
lib = "codegen/classDelegation/linkTest_lib.kt"
|
|
}
|
|
|
|
standaloneTest("contracts") {
|
|
flags = [ '-opt-in=kotlin.RequiresOptIn', '-tr' ]
|
|
source = "codegen/contracts/contracts.kt"
|
|
}
|
|
|
|
task delegatedProperty_simpleVal(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/delegatedProperty/simpleVal.kt"
|
|
}
|
|
|
|
task delegatedProperty_simpleVar(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/delegatedProperty/simpleVar.kt"
|
|
}
|
|
|
|
task delegatedProperty_packageLevel(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/delegatedProperty/packageLevel.kt"
|
|
}
|
|
|
|
task delegatedProperty_local(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/delegatedProperty/local.kt"
|
|
}
|
|
|
|
linkTest("delegatedProperty_delegatedOverride") {
|
|
useGoldenData = true
|
|
source = "codegen/delegatedProperty/delegatedOverride_main.kt"
|
|
lib = "codegen/delegatedProperty/delegatedOverride_lib.kt"
|
|
}
|
|
|
|
linkTest("delegatedProperty_correctFieldsOrder") {
|
|
useGoldenData = true
|
|
source = "codegen/delegatedProperty/correctFieldsOrder_main.kt"
|
|
lib = "codegen/delegatedProperty/correctFieldsOrder_lib.kt"
|
|
}
|
|
|
|
task delegatedProperty_lazy(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/delegatedProperty/lazy.kt"
|
|
}
|
|
|
|
task delegatedProperty_observable(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/delegatedProperty/observable.kt"
|
|
}
|
|
|
|
task delegatedProperty_map(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/delegatedProperty/map.kt"
|
|
}
|
|
|
|
task propertyCallableReference_valClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/propertyCallableReference/valClass.kt"
|
|
}
|
|
|
|
task propertyCallableReference_valModule(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/propertyCallableReference/valModule.kt"
|
|
}
|
|
|
|
task propertyCallableReference_varClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/propertyCallableReference/varClass.kt"
|
|
}
|
|
|
|
task propertyCallableReference_varModule(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/propertyCallableReference/varModule.kt"
|
|
}
|
|
|
|
task propertyCallableReference_valExtension(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/propertyCallableReference/valExtension.kt"
|
|
}
|
|
|
|
task propertyCallableReference_varExtension(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/propertyCallableReference/varExtension.kt"
|
|
}
|
|
|
|
linkTest("propertyCallableReference_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/propertyCallableReference/linkTest_main.kt"
|
|
lib = "codegen/propertyCallableReference/linkTest_lib.kt"
|
|
}
|
|
|
|
task propertyCallableReference_dynamicReceiver(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/propertyCallableReference/dynamicReceiver.kt"
|
|
}
|
|
|
|
task lateinit_initialized(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/initialized.kt"
|
|
}
|
|
|
|
task lateinit_notInitialized(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/notInitialized.kt"
|
|
}
|
|
|
|
task lateinit_inBaseClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/inBaseClass.kt"
|
|
}
|
|
|
|
task lateinit_localInitialized(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/localInitialized.kt"
|
|
}
|
|
|
|
task lateinit_localNotInitialized(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/localNotInitialized.kt"
|
|
}
|
|
|
|
task lateinit_localCapturedInitialized(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/localCapturedInitialized.kt"
|
|
}
|
|
|
|
task lateinit_localCapturedNotInitialized(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/localCapturedNotInitialized.kt"
|
|
}
|
|
|
|
task lateinit_isInitialized(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/isInitialized.kt"
|
|
}
|
|
|
|
task lateinit_globalIsInitialized(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/globalIsInitialized.kt"
|
|
}
|
|
|
|
task lateinit_innerIsInitialized(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lateinit/innerIsInitialized.kt"
|
|
}
|
|
|
|
task sanity_assertions_enabled_for_local_tests(type: KonanLocalTest) {
|
|
source = "sanity/assertions_enabled_for_local_tests.kt"
|
|
}
|
|
|
|
task kclass0(type: KonanLocalTest) {
|
|
source = "codegen/kclass/kclass0.kt"
|
|
}
|
|
|
|
task kclass1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/kclass/kclass1.kt"
|
|
}
|
|
|
|
task kclassEnumArgument(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/kclass/kClassEnumArgument.kt"
|
|
}
|
|
|
|
task ktype1(type: KonanLocalTest) {
|
|
source = "codegen/ktype/ktype1.kt"
|
|
}
|
|
|
|
task ktype_nonReified(type: KonanLocalTest) {
|
|
source = "codegen/ktype/nonReified.kt"
|
|
}
|
|
|
|
task associatedObjects1(type: KonanLocalTest) {
|
|
source = "codegen/associatedObjects/associatedObjects1.kt"
|
|
}
|
|
|
|
task coroutines_simple(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/simple.kt"
|
|
}
|
|
|
|
task coroutines_degenerate1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/degenerate1.kt"
|
|
}
|
|
|
|
task coroutines_degenerate2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/degenerate2.kt"
|
|
}
|
|
|
|
task coroutines_withReceiver(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/withReceiver.kt"
|
|
}
|
|
|
|
task coroutines_correctOrder1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/correctOrder1.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_chain(type: KonanLocalTest) {
|
|
source = "codegen/coroutines/controlFlow_chain.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_if1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_if1.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_if2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_if2.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_finally1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_finally1.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_finally2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_finally2.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_finally3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_finally3.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_finally4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_finally4.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_finally5(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_finally5.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_finally6(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_finally6.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_finally7(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_finally7.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_inline1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_inline1.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_inline2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_inline2.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_inline3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_inline3.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_tryCatch1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_tryCatch1.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_tryCatch2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_tryCatch2.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_tryCatch3(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_tryCatch3.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_tryCatch4(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_tryCatch4.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_tryCatch5(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_tryCatch5.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_while1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_while1.kt"
|
|
}
|
|
|
|
task coroutines_controlFlow_while2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/controlFlow_while2.kt"
|
|
}
|
|
|
|
task coroutines_returnsNothing1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/returnsNothing1.kt"
|
|
}
|
|
|
|
task coroutines_returnsUnit1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/returnsUnit1.kt"
|
|
}
|
|
|
|
task coroutines_coroutineContext1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/coroutineContext1.kt"
|
|
}
|
|
|
|
task coroutines_coroutineContext2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/coroutineContext2.kt"
|
|
}
|
|
|
|
task coroutines_anonymousObject(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/anonymousObject.kt"
|
|
}
|
|
|
|
task coroutines_functionReference_simple(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/functionReference_simple.kt"
|
|
}
|
|
|
|
task coroutines_functionReference_eqeq_name(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/functionReference_eqeq_name.kt"
|
|
}
|
|
|
|
task coroutines_functionReference_invokeAsFunction(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/functionReference_invokeAsFunction.kt"
|
|
}
|
|
|
|
task coroutines_functionReference_lambdaAsSuspendLambda(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/functionReference_lambdaAsSuspendLambda.kt"
|
|
}
|
|
|
|
task coroutines_kt41394(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/kt41394.kt"
|
|
}
|
|
|
|
task coroutines_inheritance(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/inheritance.kt"
|
|
}
|
|
|
|
standaloneTest('coroutines_suspendConversion') {
|
|
useGoldenData = true
|
|
source = "codegen/coroutines/suspendConversion.kt"
|
|
flags = ['-XXLanguage:+SuspendConversion']
|
|
}
|
|
|
|
task AbstractMutableCollection(type: KonanLocalTest) {
|
|
expectedExitStatus = 0
|
|
source = "runtime/collections/AbstractMutableCollection.kt"
|
|
}
|
|
|
|
task BitSet(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
expectedExitStatus = 0
|
|
source = "runtime/collections/BitSet.kt"
|
|
}
|
|
|
|
task stack_array(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/stack_array.kt"
|
|
}
|
|
|
|
task array0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/array0.kt"
|
|
}
|
|
|
|
task array1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/array1.kt"
|
|
}
|
|
|
|
task array2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/array2.kt"
|
|
}
|
|
|
|
task array3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/array3.kt"
|
|
}
|
|
|
|
task array4(type: KonanLocalTest) {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "runtime/collections/array4.kt"
|
|
}
|
|
|
|
task array5(type: KonanLocalTest) {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "runtime/collections/array5.kt"
|
|
}
|
|
|
|
task typed_array0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/typed_array0.kt"
|
|
}
|
|
|
|
task typed_array1(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // No exceptions on WASM.
|
|
useGoldenData = true
|
|
source = "runtime/collections/typed_array1.kt"
|
|
}
|
|
|
|
|
|
task sort0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/sort0.kt"
|
|
}
|
|
|
|
task sort1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/sort1.kt"
|
|
}
|
|
|
|
task sortWith(type: KonanLocalTest) {
|
|
source = "runtime/collections/SortWith.kt"
|
|
}
|
|
|
|
task if_else(type: KonanLocalTest) {
|
|
source = "codegen/branching/if_else.kt"
|
|
}
|
|
|
|
task immutable_binary_blob_in_lambda(type: KonanLocalTest) {
|
|
source = "lower/immutable_blob_in_lambda.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task when2(type: KonanLocalTest) {
|
|
source = "codegen/branching/when2.kt"
|
|
}
|
|
|
|
task when5(type: KonanLocalTest) {
|
|
source = "codegen/branching/when5.kt"
|
|
}
|
|
|
|
task when6(type: KonanLocalTest) {
|
|
source = "codegen/branching/when6.kt"
|
|
}
|
|
|
|
task when7(type: KonanLocalTest) {
|
|
source = "codegen/branching/when7.kt"
|
|
}
|
|
|
|
task when8(type: KonanLocalTest) {
|
|
source = "codegen/branching/when8.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task when9(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/branching/when9.kt"
|
|
}
|
|
|
|
task when_through(type: KonanLocalTest) {
|
|
source = "codegen/branching/when_through.kt"
|
|
}
|
|
|
|
task advanced_when2(type: KonanLocalTest) {
|
|
source = "codegen/branching/advanced_when2.kt"
|
|
}
|
|
|
|
task advanced_when5(type: KonanLocalTest) {
|
|
source = "codegen/branching/advanced_when5.kt"
|
|
}
|
|
|
|
task when_with_try1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/branching/when_with_try1.kt"
|
|
}
|
|
|
|
task arraysForLoops(type: KonanLocalTest) {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "codegen/bce/arraysForLoops.kt"
|
|
}
|
|
|
|
task bool_yes(type: KonanLocalTest) {
|
|
source = "codegen/function/boolean.kt"
|
|
}
|
|
|
|
task named(type: KonanLocalTest) {
|
|
source = "codegen/function/named.kt"
|
|
}
|
|
|
|
|
|
task plus_eq(type: KonanLocalTest) {
|
|
source = "codegen/function/plus_eq.kt"
|
|
}
|
|
|
|
task minus_eq(type: KonanLocalTest) {
|
|
source = "codegen/function/minus_eq.kt"
|
|
}
|
|
|
|
task eqeq(type: KonanLocalTest) {
|
|
source = "codegen/function/eqeq.kt"
|
|
}
|
|
|
|
task function_referenceBigArity(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/function/referenceBigArity.kt"
|
|
}
|
|
|
|
task cycle(type: KonanLocalTest) {
|
|
source = "codegen/cycles/cycle.kt"
|
|
}
|
|
|
|
task cycle_do(type: KonanLocalTest) {
|
|
source = "codegen/cycles/cycle_do.kt"
|
|
}
|
|
|
|
task cycle_for(type: KonanLocalTest) {
|
|
source = "codegen/cycles/cycle_for.kt"
|
|
}
|
|
|
|
task abstract_super(type: KonanLocalTest) {
|
|
source = "datagen/rtti/abstract_super.kt"
|
|
}
|
|
|
|
task vtable1(type: KonanLocalTest) {
|
|
source = "datagen/rtti/vtable1.kt"
|
|
}
|
|
|
|
task vtable_any(type: KonanLocalTest) {
|
|
source = "datagen/rtti/vtable_any.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task strdedup1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "datagen/literals/strdedup1.kt"
|
|
}
|
|
|
|
task strdedup2(type: KonanLocalTest) {
|
|
// TODO: string deduplication across several components seems to require
|
|
// linking them as bitcode modules before translating to machine code.
|
|
enabled = false
|
|
|
|
useGoldenData = true
|
|
source = "datagen/literals/strdedup2.kt"
|
|
}
|
|
|
|
task empty_string(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "datagen/literals/empty_string.kt"
|
|
}
|
|
|
|
task intrinsic(type: KonanLocalTest) {
|
|
source = "codegen/function/intrinsic.kt"
|
|
}
|
|
|
|
// Disabled until we extract the classes that should be
|
|
// always present from stdlib into a separate binary.
|
|
//
|
|
//linkTest("link") {
|
|
// useGoldenData = true
|
|
// source = "link/src/bar.kt"
|
|
// lib = "link/lib"
|
|
//}(
|
|
|
|
linkTest("link_omit_unused") {
|
|
useGoldenData = true
|
|
source = "link/omit/main.kt"
|
|
lib = "link/omit/library.kt"
|
|
}
|
|
|
|
standaloneTest("link_default_libs") {
|
|
enabled = (project.testTarget != 'wasm32') // there will be no posix.klib for wasm
|
|
useGoldenData = true
|
|
source = "link/default/default.kt"
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
standaloneTest("link_testLib_explicitly1") {
|
|
// there is no testLibrary for cross targets yet.
|
|
enabled = project.target.name == project.hostName &&
|
|
(project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM)
|
|
dependsOn installTestLib
|
|
useGoldenData = true
|
|
source = "link/testLib_explicitly1.kt"
|
|
// We force library inclusion, so need to see the warning banner.
|
|
flags = ['-l', 'testLibrary', '-r', testLibraryDir]
|
|
doLast {
|
|
def file = new File("$testLibraryDir/testLibrary")
|
|
file.deleteDir()
|
|
}
|
|
}
|
|
|
|
standaloneTest("link_testLib_explicitly2") {
|
|
// there is no testLibrary for cross targets yet.
|
|
enabled = project.target.name == project.hostName &&
|
|
!(project.globalTestArgs.contains('-Xir-property-lazy-initialization=enable') || isExperimentalMM)
|
|
dependsOn installTestLib
|
|
useGoldenData = true
|
|
source = "link/testLib_explicitly2.kt"
|
|
// We force library inclusion, so need to see the warning banner.
|
|
flags = ['-l', 'testLibrary', '-r', testLibraryDir]
|
|
doLast {
|
|
def file = new File("$testLibraryDir/testLibrary")
|
|
file.deleteDir()
|
|
}
|
|
}
|
|
|
|
linkTest("no_purge_for_dependencies") {
|
|
enabled = (project.testTarget != 'wasm32') // there will be no posix.klib for wasm
|
|
useGoldenData = true
|
|
source = "link/purge1/prog.kt"
|
|
lib = "link/purge1/lib.kt"
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
linkTest("lib@name") {
|
|
useGoldenData = true
|
|
source = "link/klib_name/prog.kt"
|
|
lib = "link/klib_name/lib.kt"
|
|
}
|
|
|
|
task for0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/for0.kt"
|
|
}
|
|
|
|
task throw0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/throw0.kt"
|
|
}
|
|
|
|
task statements0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/statements0.kt"
|
|
}
|
|
|
|
standaloneTest("annotations0") {
|
|
source = "codegen/annotations/annotations0.kt"
|
|
flags = ['-tr']
|
|
}
|
|
|
|
task boxing0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing0.kt"
|
|
}
|
|
|
|
task boxing1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing1.kt"
|
|
}
|
|
|
|
task boxing2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing2.kt"
|
|
}
|
|
|
|
task boxing3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing3.kt"
|
|
}
|
|
|
|
task boxing4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing4.kt"
|
|
}
|
|
|
|
task boxing5(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing5.kt"
|
|
}
|
|
|
|
task boxing6(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing6.kt"
|
|
}
|
|
|
|
task boxing7(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing7.kt"
|
|
}
|
|
|
|
task boxing8(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing8.kt"
|
|
}
|
|
|
|
task boxing9(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing9.kt"
|
|
}
|
|
|
|
task boxing10(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing10.kt"
|
|
}
|
|
|
|
task boxing11(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing11.kt"
|
|
}
|
|
|
|
task boxing12(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing12.kt"
|
|
}
|
|
|
|
task boxing13(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing13.kt"
|
|
}
|
|
|
|
task boxing14(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing14.kt"
|
|
}
|
|
|
|
task boxing15(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/boxing15.kt"
|
|
}
|
|
|
|
task kt53100_casts(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/kt53100_casts.kt"
|
|
}
|
|
|
|
task boxCache0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/boxing/box_cache0.kt"
|
|
}
|
|
|
|
task interface0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/interface0.kt"
|
|
}
|
|
|
|
task hash0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/hash0.kt"
|
|
}
|
|
|
|
task ieee754(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/ieee754.kt"
|
|
}
|
|
|
|
standaloneTest("hypotenuse") {
|
|
source = "runtime/basic/hypot.kt"
|
|
}
|
|
|
|
task array_list1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/array_list1.kt"
|
|
}
|
|
|
|
task array_list2(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // uses exceptions
|
|
useGoldenData = true
|
|
source = "runtime/collections/array_list2.kt"
|
|
}
|
|
|
|
task hash_map0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/hash_map0.kt"
|
|
}
|
|
|
|
task hash_map1(type: KonanLocalTest) {
|
|
disabled = isAggressiveGC // TODO: Investigate why too slow
|
|
useGoldenData = true
|
|
source = "runtime/collections/hash_map1.kt"
|
|
}
|
|
|
|
task hash_set0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/hash_set0.kt"
|
|
}
|
|
|
|
task listof0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/listof0.kt"
|
|
}
|
|
|
|
task listof1(type: KonanLocalTest) {
|
|
enabled = false
|
|
useGoldenData = true
|
|
source = "datagen/literals/listof1.kt"
|
|
}
|
|
|
|
|
|
task moderately_large_array(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/moderately_large_array.kt"
|
|
}
|
|
|
|
task moderately_large_array1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/moderately_large_array1.kt"
|
|
}
|
|
|
|
task string_builder0(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "runtime/text/string_builder0.kt"
|
|
}
|
|
|
|
task string_builder1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/text/string_builder1.kt"
|
|
}
|
|
|
|
task string0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/text/string0.kt"
|
|
}
|
|
|
|
task parse0(type: KonanLocalTest) {
|
|
source = "runtime/text/parse0.kt"
|
|
}
|
|
|
|
task to_string0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/text/to_string0.kt"
|
|
}
|
|
|
|
task trim(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions
|
|
useGoldenData = true
|
|
source = "runtime/text/trim.kt"
|
|
}
|
|
|
|
task chars0(type: KonanLocalTest) {
|
|
disabled = isAggressiveGC // TODO: Investigate why too slow
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "runtime/text/chars0.kt"
|
|
expectedExitStatus = 0
|
|
}
|
|
|
|
task indexof(type: KonanLocalTest) {
|
|
source = "runtime/text/indexof.kt"
|
|
}
|
|
|
|
task utf8(type: KonanLocalTest) {
|
|
// Uses exceptions so cannot run on wasm.
|
|
enabled = project.testTarget != 'wasm32'
|
|
&& !isAggressiveGC // TODO: Investigate why too slow
|
|
useGoldenData = true
|
|
source = "runtime/text/utf8.kt"
|
|
}
|
|
|
|
task catch1(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "runtime/exceptions/catch1.kt"
|
|
}
|
|
|
|
task catch2(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "runtime/exceptions/catch2.kt"
|
|
}
|
|
|
|
task catch7(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "runtime/exceptions/catch7.kt"
|
|
}
|
|
|
|
task extend_exception(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/exceptions/extend0.kt"
|
|
}
|
|
|
|
standaloneTest("check_stacktrace_format_coresymbolication") {
|
|
disabled = !supportsCoreSymbolication(project) || project.globalTestArgs.contains('-opt')
|
|
flags = ['-g', '-Xbinary=sourceInfoType=coresymbolication']
|
|
arguments = ['coresymbolication']
|
|
source = "runtime/exceptions/check_stacktrace_format.kt"
|
|
}
|
|
|
|
standaloneTest("stack_trace_inline") {
|
|
disabled = !supportsCoreSymbolication(project) || project.globalTestArgs.contains('-opt')
|
|
flags = ['-g', '-Xg-generate-debug-trampoline=enable', '-Xbinary=sourceInfoType=coresymbolication']
|
|
source = "runtime/exceptions/stack_trace_inline.kt"
|
|
arguments = ['coresymbolication']
|
|
}
|
|
|
|
standaloneTest("kt-49240-stack-trace-completeness") {
|
|
disabled = !supportsExceptions(project) || project.globalTestArgs.contains('-opt') ||
|
|
project.testTarget == 'linux_mips32' // https://youtrack.jetbrains.com/issue/KT-48949/Linux-MIPS32-libbacktrace-stacktrace-has-no-lines
|
|
source = "runtime/exceptions/kt-49240-stack-trace-completeness.kt"
|
|
}
|
|
|
|
standaloneTest("kt-37572") {
|
|
disabled = !supportsCoreSymbolication(project) || project.globalTestArgs.contains('-opt')
|
|
flags = ['-g', '-Xbinary=sourceInfoType=coresymbolication']
|
|
arguments = ['coresymbolication']
|
|
source = "runtime/exceptions/kt-37572.kt"
|
|
}
|
|
|
|
standaloneTest("check_stacktrace_format_libbacktrace") {
|
|
disabled = !supportsLibBacktrace(project)|| project.globalTestArgs.contains('-opt')
|
|
flags = ['-g', '-Xbinary=sourceInfoType=libbacktrace']
|
|
arguments = ['libbacktrace']
|
|
source = "runtime/exceptions/check_stacktrace_format.kt"
|
|
}
|
|
|
|
standaloneTest("stack_trace_inline_libbacktrace") {
|
|
disabled = !supportsLibBacktrace(project) || project.globalTestArgs.contains('-opt')
|
|
flags = ['-g', '-Xbinary=sourceInfoType=libbacktrace']
|
|
arguments = ['libbacktrace']
|
|
source = "runtime/exceptions/stack_trace_inline.kt"
|
|
}
|
|
|
|
standaloneTest("kt-37572-libbacktrace") {
|
|
disabled = !supportsLibBacktrace(project) || project.globalTestArgs.contains('-opt')
|
|
flags = ['-g', '-Xbinary=sourceInfoType=libbacktrace']
|
|
arguments = ['libbacktrace']
|
|
source = "runtime/exceptions/kt-37572.kt"
|
|
}
|
|
|
|
standaloneTest("except_constr_w_default") {
|
|
disabled = !supportsLibBacktrace(project) || project.globalTestArgs.contains('-opt')
|
|
flags = ['-g', '-Xbinary=sourceInfoType=libbacktrace']
|
|
source = "runtime/exceptions/except_constr_w_default.kt"
|
|
}
|
|
|
|
standaloneTest("throw_from_except_constr") {
|
|
disabled = !supportsLibBacktrace(project) || project.globalTestArgs.contains('-opt')
|
|
flags = ['-g', '-Xbinary=sourceInfoType=libbacktrace']
|
|
source = "runtime/exceptions/throw_from_except_constr.kt"
|
|
}
|
|
|
|
standaloneTest("custom_hook") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
outputChecker = {
|
|
it.contains("value 42: Error. Runnable state: true") && it.contains("Uncaught Kotlin exception: kotlin.Error: an error")
|
|
}
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/exceptions/custom_hook.kt"
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
standaloneTest("custom_hook_memory_leak") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
outputChecker = {
|
|
it.contains("Hook 42") && it.contains("Uncaught Kotlin exception: kotlin.Error: an error")
|
|
}
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/exceptions/custom_hook_memory_leak.kt"
|
|
}
|
|
|
|
standaloneTest("custom_hook_get") {
|
|
source = "runtime/exceptions/custom_hook_get.kt"
|
|
}
|
|
|
|
standaloneTest("custom_hook_no_reset") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
outputChecker = {
|
|
it.contains("Hook called") && it.contains("Uncaught Kotlin exception: kotlin.Error: some error")
|
|
}
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/exceptions/custom_hook_no_reset.kt"
|
|
}
|
|
|
|
standaloneTest("custom_hook_throws") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
outputChecker = {
|
|
it.contains("Hook called") && it.contains("Uncaught Kotlin exception: kotlin.Error: another error") && !it.contains("some error")
|
|
}
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/exceptions/custom_hook_throws.kt"
|
|
}
|
|
|
|
standaloneTest("custom_hook_unhandled_exception") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "runtime/exceptions/custom_hook_unhandled_exception.kt"
|
|
}
|
|
|
|
standaloneTest("custom_hook_terminate") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
outputChecker = {
|
|
it.contains("Hook called")
|
|
}
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/exceptions/custom_hook_terminate.kt"
|
|
}
|
|
|
|
standaloneTest("custom_hook_terminate_unhandled_exception") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
outputChecker = {
|
|
it.contains("Hook called") && it.contains("Uncaught Kotlin exception: kotlin.Error: some error") && !it.contains("Not going to happen")
|
|
}
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/exceptions/custom_hook_terminate_unhandled_exception.kt"
|
|
}
|
|
|
|
standaloneTest("exception_in_global_init") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
source = "runtime/exceptions/exception_in_global_init.kt"
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> s.contains("Uncaught Kotlin exception:") && s.contains("FAIL") && !s.contains("in kotlin main") }
|
|
}
|
|
|
|
task rethrow_exception(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
source = "runtime/exceptions/rethrow.kt"
|
|
}
|
|
|
|
task throw_from_catch(type: KonanLocalTest) {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
source = "runtime/exceptions/throw_from_catch.kt"
|
|
}
|
|
|
|
standaloneTest("terminate") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/exceptions/terminate.kt"
|
|
}
|
|
|
|
standaloneTest("unhandled_exception") {
|
|
enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
outputChecker = {
|
|
it.contains("Uncaught Kotlin exception: kotlin.Error: some error")
|
|
}
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/exceptions/unhandled_exception.kt"
|
|
}
|
|
|
|
standaloneTest("runtime_math_exceptions") {
|
|
enabled = (project.testTarget != 'wasm32')
|
|
source = "stdlib_external/numbers/MathExceptionTest.kt"
|
|
flags = ['-tr']
|
|
}
|
|
|
|
standaloneTest("runtime_math") {
|
|
source = "stdlib_external/numbers/MathTest.kt"
|
|
flags = ['-tr']
|
|
}
|
|
|
|
standaloneTest("runtime_math_harmony") {
|
|
source = "stdlib_external/numbers/HarmonyMathTests.kt"
|
|
flags = ['-tr']
|
|
}
|
|
|
|
task catch3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/catch3.kt"
|
|
}
|
|
|
|
task catch4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/catch4.kt"
|
|
}
|
|
|
|
task catch5(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/try/catch5.kt"
|
|
}
|
|
|
|
task catch6(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/try/catch6.kt"
|
|
}
|
|
|
|
task catch8(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/catch8.kt"
|
|
}
|
|
|
|
task finally1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally1.kt"
|
|
}
|
|
|
|
task finally2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally2.kt"
|
|
}
|
|
|
|
task finally3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally3.kt"
|
|
}
|
|
|
|
task finally4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally4.kt"
|
|
}
|
|
|
|
task finally5(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally5.kt"
|
|
}
|
|
|
|
task finally6(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally6.kt"
|
|
}
|
|
|
|
task finally7(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally7.kt"
|
|
}
|
|
|
|
task finally8(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally8.kt"
|
|
}
|
|
|
|
task finally9(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally9.kt"
|
|
}
|
|
|
|
task finally10(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally10.kt"
|
|
}
|
|
|
|
task finally11(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/finally11.kt"
|
|
}
|
|
|
|
task finally_returnsDifferentTypes(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/returnsDifferentTypes.kt"
|
|
}
|
|
|
|
task scope1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/dataflow/scope1.kt"
|
|
}
|
|
|
|
task uninitialized_val(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/dataflow/uninitialized_val.kt"
|
|
}
|
|
|
|
task try1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/try1.kt"
|
|
}
|
|
|
|
task try2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/try2.kt"
|
|
}
|
|
|
|
task try3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/try3.kt"
|
|
}
|
|
|
|
task try4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/try/try4.kt"
|
|
}
|
|
|
|
task unreachable1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/controlflow/unreachable1.kt"
|
|
}
|
|
|
|
task break_continue(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/controlflow/break.kt"
|
|
}
|
|
|
|
task break1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/controlflow/break1.kt"
|
|
}
|
|
|
|
task range0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/collections/range0.kt"
|
|
}
|
|
|
|
standaloneTest("args0") {
|
|
arguments = ["AAA", "BB", "C"]
|
|
useGoldenData = true
|
|
source = "runtime/basic/args0.kt"
|
|
}
|
|
|
|
standaloneTest("devirtualization_lateinitInterface") {
|
|
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
|
|
useGoldenData = true
|
|
flags = ["-opt"]
|
|
source = "codegen/devirtualization/lateinitInterface.kt"
|
|
}
|
|
|
|
standaloneTest("devirtualization_getter_looking_as_box_function") {
|
|
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
|
|
useGoldenData = true
|
|
flags = ["-opt"]
|
|
source = "codegen/devirtualization/getter_looking_as_box_function.kt"
|
|
}
|
|
|
|
standaloneTest("devirtualization_inline_getter") {
|
|
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
|
|
useGoldenData = true
|
|
flags = ["-opt"]
|
|
source = "codegen/devirtualization/inline_getter.kt"
|
|
}
|
|
|
|
|
|
standaloneTest("devirtualization_anonymousObject") {
|
|
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
|
|
useGoldenData = true
|
|
flags = ["-opt"]
|
|
source = "codegen/devirtualization/anonymousObject.kt"
|
|
}
|
|
|
|
task interfaceCallsNCasts_conservativeItable(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/interfaceCallsNCasts/conservativeItable.kt"
|
|
}
|
|
|
|
task interfaceCallsNCasts_functionNameClash(type: KonanLocalTest) {
|
|
source = "codegen/interfaceCallsNCasts/functionNameClash.kt"
|
|
}
|
|
|
|
task interfaceCallsNCasts_finalMethod(type: KonanLocalTest) {
|
|
source = "codegen/interfaceCallsNCasts/finalMethod.kt"
|
|
}
|
|
|
|
task interfaceCallsNCasts_diamond(type: KonanLocalTest) {
|
|
source = "codegen/interfaceCallsNCasts/diamond.kt"
|
|
}
|
|
|
|
task spread_operator_0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/spread_operator_0.kt"
|
|
}
|
|
|
|
task main_exception(type: KonanLocalTest) {
|
|
outputChecker = { s -> s.contains("kotlin.Error: Hello!") }
|
|
expectedExitStatus = 1
|
|
source = "runtime/basic/main_exception.kt"
|
|
}
|
|
|
|
task runtime_basic_standard(type: KonanLocalTest) {
|
|
source = "runtime/basic/standard.kt"
|
|
}
|
|
|
|
standaloneTest("runtime_basic_assert_failed") {
|
|
expectedExitStatusChecker = { it != 0 }
|
|
source = "runtime/basic/assert_failed.kt"
|
|
}
|
|
|
|
standaloneTest("runtime_basic_assert_passed") {
|
|
expectedExitStatus = 0
|
|
source = "runtime/basic/assert_passed.kt"
|
|
}
|
|
|
|
standaloneTest("runtime_basic_assert_disabled") {
|
|
expectedExitStatus = 0
|
|
enableKonanAssertions = false
|
|
source = "runtime/basic/assert_failed.kt"
|
|
}
|
|
|
|
task initializers0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/initializers0.kt"
|
|
}
|
|
|
|
|
|
task initializers1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
enabled = false
|
|
source = "runtime/basic/initializers1.kt"
|
|
}
|
|
|
|
|
|
task concatenation(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/concatenation.kt"
|
|
}
|
|
|
|
task const_infinity(type: KonanLocalTest) {
|
|
source = "codegen/basics/const_infinity.kt"
|
|
}
|
|
|
|
task lambda1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda1.kt"
|
|
}
|
|
|
|
task lambda2(type: KonanLocalTest) {
|
|
arguments = ["arg0"]
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda2.kt"
|
|
}
|
|
|
|
task lambda3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda3.kt"
|
|
}
|
|
|
|
task lambda4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda4.kt"
|
|
}
|
|
|
|
task lambda5(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda5.kt"
|
|
}
|
|
|
|
task lambda6(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda6.kt"
|
|
}
|
|
|
|
task lambda7(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda7.kt"
|
|
}
|
|
|
|
task lambda8(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda8.kt"
|
|
}
|
|
|
|
task lambda9(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda9.kt"
|
|
}
|
|
|
|
task lambda10(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda10.kt"
|
|
}
|
|
|
|
task lambda11(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda11.kt"
|
|
}
|
|
|
|
task lambda12(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda12.kt"
|
|
}
|
|
|
|
task lambda13(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/lambda/lambda13.kt"
|
|
}
|
|
|
|
standaloneTest("lambda14") {
|
|
source = "codegen/lambda/lambda14.kt"
|
|
flags = ['-tr']
|
|
}
|
|
|
|
task lambda_kt49360(type: KonanLocalTest) {
|
|
source = "codegen/lambda/lambda_kt49360.kt"
|
|
}
|
|
|
|
task funInterface_implIsNotFunction(type: KonanLocalTest) {
|
|
source = "codegen/funInterface/implIsNotFunction.kt"
|
|
}
|
|
|
|
task funInterface_nonTrivialProjectionInSuperType(type: KonanLocalTest) {
|
|
source = "codegen/funInterface/nonTrivialProjectionInSuperType.kt"
|
|
}
|
|
|
|
task funInterface_kt43887(type: KonanLocalTest) {
|
|
source = "codegen/funInterface/kt43887.kt"
|
|
}
|
|
|
|
task funInterface_kt49384(type: KonanLocalTest) {
|
|
source = "codegen/funInterface/kt49384.kt"
|
|
}
|
|
|
|
task objectExpression1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/objectExpression/expr1.kt"
|
|
}
|
|
|
|
task objectExpression2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/objectExpression/expr2.kt"
|
|
}
|
|
|
|
task objectExpression3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/objectExpression/expr3.kt"
|
|
}
|
|
|
|
standaloneTest("initializers2") {
|
|
useGoldenData = true
|
|
|
|
source = "runtime/basic/initializers2.kt"
|
|
}
|
|
|
|
task initializers3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/initializers3.kt"
|
|
}
|
|
|
|
task initializers4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/initializers4.kt"
|
|
}
|
|
|
|
task initializers5(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/basic/initializers5.kt"
|
|
}
|
|
|
|
task initializers6(type: KonanLocalTest) {
|
|
disabled = (project.testTarget == 'wasm32') // Needs workers.
|
|
source = "runtime/basic/initializers6.kt"
|
|
}
|
|
|
|
task initializers7(type: KonanLocalTest) {
|
|
source = "runtime/basic/initializers7.kt"
|
|
}
|
|
|
|
task initializers8(type: KonanLocalTest) {
|
|
source = "runtime/basic/initializers8.kt"
|
|
}
|
|
|
|
task expression_as_statement(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/basics/expression_as_statement.kt"
|
|
}
|
|
|
|
task codegen_escapeAnalysis_zeroOutObjectOnAlloc(type: KonanLocalTest) {
|
|
source = "codegen/escapeAnalysis/zeroOutObjectOnAlloc.kt"
|
|
}
|
|
|
|
task codegen_escapeAnalysis_recursion(type: KonanLocalTest) {
|
|
source = "codegen/escapeAnalysis/recursion.kt"
|
|
}
|
|
|
|
standaloneTest("codegen_escapeAnalysis_stackAllocated") {
|
|
disabled = (cacheTesting != null) || // Cache is not compatible with -opt.
|
|
project.globalTestArgs.contains('-g') // -g and -opt are incompatible
|
|
flags = ['-opt', '-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
source = "codegen/escapeAnalysis/stackAllocated.kt"
|
|
}
|
|
|
|
standaloneTest("codegen_escapeAnalysis_string") {
|
|
disabled = (cacheTesting != null) || // Cache is not compatible with -opt.
|
|
project.globalTestArgs.contains('-g') || // -g and -opt are incompatible
|
|
!isExperimentalMM // strings are frozen in legacy GC
|
|
flags = ['-opt', '-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
source = "codegen/escapeAnalysis/string.kt"
|
|
}
|
|
|
|
task memory_var1(type: KonanLocalTest) {
|
|
source = "runtime/memory/var1.kt"
|
|
}
|
|
|
|
task memory_var2(type: KonanLocalTest) {
|
|
source = "runtime/memory/var2.kt"
|
|
}
|
|
|
|
task memory_var3(type: KonanLocalTest) {
|
|
source = "runtime/memory/var3.kt"
|
|
}
|
|
|
|
task memory_var4(type: KonanLocalTest) {
|
|
source = "runtime/memory/var4.kt"
|
|
}
|
|
|
|
task memory_throw_cleanup(type: KonanLocalTest) {
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "runtime/memory/throw_cleanup.kt"
|
|
}
|
|
|
|
task memory_escape0(type: KonanLocalTest) {
|
|
source = "runtime/memory/escape0.kt"
|
|
}
|
|
|
|
task memory_escape1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/memory/escape1.kt"
|
|
}
|
|
|
|
task memory_cycles0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/memory/cycles0.kt"
|
|
}
|
|
|
|
task memory_cycles1(type: KonanLocalTest) {
|
|
enabled = !isNoopGC
|
|
source = "runtime/memory/cycles1.kt"
|
|
}
|
|
|
|
task memory_basic0(type: KonanLocalTest) {
|
|
source = "runtime/memory/basic0.kt"
|
|
}
|
|
|
|
task memory_escape2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/memory/escape2.kt"
|
|
}
|
|
|
|
task memory_weak0(type: KonanLocalTest) {
|
|
enabled = !isNoopGC
|
|
useGoldenData = true
|
|
source = "runtime/memory/weak0.kt"
|
|
}
|
|
|
|
task memory_weak1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "runtime/memory/weak1.kt"
|
|
}
|
|
|
|
standaloneTest("memory_only_gc") {
|
|
source = "runtime/memory/only_gc.kt"
|
|
}
|
|
|
|
task memory_stable_ref_cross_thread_check(type: KonanLocalTest) {
|
|
disabled = (project.testTarget == 'wasm32') // Needs workers.
|
|
source = "runtime/memory/stable_ref_cross_thread_check.kt"
|
|
}
|
|
|
|
standaloneTest("cycle_detector") {
|
|
disabled = project.globalTestArgs.contains('-opt') || // Needs debug build.
|
|
(project.testTarget == 'wasm32') || // CycleDetector is disabled on WASM.
|
|
isExperimentalMM // Experimental MM will not support CycleDetector.
|
|
flags = ['-tr', '-g']
|
|
source = "runtime/memory/cycle_detector.kt"
|
|
}
|
|
|
|
standaloneTest("cycle_collector") {
|
|
disabled = true // Needs USE_CYCLIC_GC, which is disabled.
|
|
source = "runtime/memory/cycle_collector.kt"
|
|
}
|
|
|
|
standaloneTest("cycle_collector_deadlock1") {
|
|
disabled = true // Needs USE_CYCLIC_GC, which is disabled.
|
|
source = "runtime/memory/cycle_collector_deadlock1.kt"
|
|
}
|
|
|
|
standaloneTest("leakMemory") {
|
|
source = "runtime/memory/leak_memory.kt"
|
|
if (!isExperimentalMM) { // Experimental MM will not report memory leaks.
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> s.contains("Memory leaks detected, 1 objects leaked!") }
|
|
}
|
|
}
|
|
|
|
standaloneTest("leakMemoryWithTestRunner") {
|
|
source = "runtime/memory/leak_memory_test_runner.kt"
|
|
flags = ['-tr']
|
|
if (!isExperimentalMM) { // Experimental MM will not report memory leaks.
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> s.contains("Memory leaks detected, 1 objects leaked!") }
|
|
}
|
|
}
|
|
|
|
standaloneTest("gcStats") {
|
|
source = "runtime/memory/gcStats.kt"
|
|
flags = ['-tr', "-Xbinary=gcSchedulerType=disabled"]
|
|
enabled = isExperimentalMM && !isNoopGC && !isAggressiveGC
|
|
}
|
|
|
|
standaloneTest("stress_gc_allocations") {
|
|
// TODO: Support obtaining peak RSS on more platforms.
|
|
enabled = (project.testTarget != "wasm32") &&
|
|
(project.testTarget != "watchos_arm32") &&
|
|
(project.testTarget != "watchos_arm64") &&
|
|
(project.testTarget != "watchos_x86") &&
|
|
(project.testTarget != "watchos_x64") &&
|
|
(project.testTarget != "watchos_simulator_arm64") &&
|
|
!isNoopGC &&
|
|
!isAggressiveGC && // TODO: Investigate why too slow
|
|
(project.testTarget != "mingw_x64") // TODO: Fix on mingw.
|
|
source = "runtime/memory/stress_gc_allocations.kt"
|
|
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
standaloneTest("array_out_of_memory") {
|
|
source = "runtime/memory/array_out_of_memory.kt"
|
|
flags = ['-tr']
|
|
switch(project.target.architecture) {
|
|
case Architecture.X64:
|
|
case Architecture.ARM64:
|
|
break;
|
|
case Architecture.X86:
|
|
case Architecture.ARM32:
|
|
case Architecture.MIPS32:
|
|
case Architecture.MIPSEL32:
|
|
case Architecture.WASM32:
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> s.contains("Out of memory trying to allocate") }
|
|
break;
|
|
}
|
|
}
|
|
|
|
standaloneTest("mpp1") {
|
|
disabled = isK2(project) // KT-56071
|
|
source = "codegen/mpp/mpp1.kt"
|
|
flags = ['-tr', '-Xmulti-platform']
|
|
}
|
|
|
|
linkTest("mpp2") {
|
|
disabled = isK2(project) // KT-56071
|
|
useGoldenData = true
|
|
source = "codegen/mpp/mpp2.kt"
|
|
lib = "codegen/mpp/libmpp2.kt"
|
|
flags = ['-Xmulti-platform']
|
|
}
|
|
|
|
standaloneTest("mpp_default_args") {
|
|
// Disabled in one stage mode because of KT-57747
|
|
disabled = !twoStageEnabled || isK2(project) // KT-56071
|
|
source = "codegen/mpp/mpp_default_args.kt"
|
|
flags = ['-tr', '-Xmulti-platform']
|
|
}
|
|
|
|
standaloneTest("mpp_optional_expectation") {
|
|
source = "codegen/mpp/mpp_optional_expectation.kt"
|
|
def outputRoot = project.ext.testOutputLocal.toString()
|
|
def srcPath = "$outputRoot/$name/mpp_optional_expectation.kt".with {
|
|
isWindows() ? it.replaceAll("/", "\\\\") : it
|
|
}
|
|
flags = [
|
|
'-Xmulti-platform',
|
|
"-Xcommon-sources=$srcPath"
|
|
]
|
|
}
|
|
|
|
standaloneTest("freezing_control_basic_full") {
|
|
enabled = isExperimentalMM && cacheTesting == null
|
|
source = "runtime/freezing_control/basic.kt"
|
|
flags = [
|
|
'-Xbinary=freezing=full',
|
|
'-friend-modules', project.rootProject.file("${UtilsKt.getKotlinNativeDist(project)}/klib/common/stdlib").absolutePath
|
|
]
|
|
arguments = ['full']
|
|
}
|
|
|
|
standaloneTest("freezing_control_basic_disabled") {
|
|
enabled = isExperimentalMM
|
|
source = "runtime/freezing_control/basic.kt"
|
|
flags = [
|
|
'-Xbinary=freezing=disabled',
|
|
'-friend-modules', project.rootProject.file("${UtilsKt.getKotlinNativeDist(project)}/klib/common/stdlib").absolutePath
|
|
]
|
|
arguments = ['disabled']
|
|
}
|
|
|
|
standaloneTest("freezing_control_basic_explicitOnly") {
|
|
enabled = isExperimentalMM && cacheTesting == null
|
|
source = "runtime/freezing_control/basic.kt"
|
|
flags = [
|
|
'-Xbinary=freezing=explicitOnly',
|
|
'-friend-modules', project.rootProject.file("${UtilsKt.getKotlinNativeDist(project)}/klib/common/stdlib").absolutePath
|
|
]
|
|
arguments = ['explicitOnly']
|
|
}
|
|
|
|
task unit1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/unit1.kt"
|
|
}
|
|
|
|
task unit2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/unit2.kt"
|
|
}
|
|
|
|
task unit3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/unit3.kt"
|
|
}
|
|
|
|
task unit4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/basics/unit4.kt"
|
|
}
|
|
|
|
task kt42000_1(type: KonanLocalTest) {
|
|
source = "codegen/basics/k42000_1.kt"
|
|
}
|
|
|
|
task kt42000_2(type: KonanLocalTest) {
|
|
source = "codegen/basics/k42000_2.kt"
|
|
}
|
|
|
|
task inline0(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline0.kt"
|
|
}
|
|
|
|
task vararg0(type: KonanLocalTest) {
|
|
source = "lower/vararg.kt"
|
|
}
|
|
|
|
task vararg_of_literals(type: KonanLocalTest) {
|
|
enabled = false
|
|
useGoldenData = true
|
|
source = "lower/vararg_of_literals.kt"
|
|
}
|
|
|
|
standaloneTest('tailrec') {
|
|
disabled = isAggressiveGC || // TODO: Investigate why too slow
|
|
isK2(project) // KT-56269
|
|
useGoldenData = true
|
|
source = "lower/tailrec.kt"
|
|
flags = ['-XXLanguage:-ProhibitTailrecOnVirtualMember', '-e', 'lower.tailrec.main']
|
|
}
|
|
|
|
task inline1(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline1.kt"
|
|
}
|
|
|
|
task inline2(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline2.kt"
|
|
}
|
|
|
|
task inline3(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline3.kt"
|
|
}
|
|
|
|
task inline4(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline4.kt"
|
|
}
|
|
|
|
task inline5(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline5.kt"
|
|
}
|
|
|
|
task inline6(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline6.kt"
|
|
}
|
|
|
|
task inline7(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline7.kt"
|
|
}
|
|
|
|
task inline8(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline8.kt"
|
|
}
|
|
|
|
task inline9(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline9.kt"
|
|
}
|
|
|
|
task inline10(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline10.kt"
|
|
}
|
|
|
|
task inline13(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline13.kt"
|
|
}
|
|
|
|
task inline14(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline14.kt"
|
|
}
|
|
|
|
task inline15(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline15.kt"
|
|
}
|
|
|
|
task inline16(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline16.kt"
|
|
}
|
|
|
|
task inline17(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline17.kt"
|
|
}
|
|
|
|
task inline18(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline18.kt"
|
|
}
|
|
|
|
task inline19(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline19.kt"
|
|
}
|
|
|
|
task inline20(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline20.kt"
|
|
}
|
|
|
|
task inline21(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline21.kt"
|
|
}
|
|
|
|
task inline22(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline22.kt"
|
|
}
|
|
|
|
task inline23(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline23.kt"
|
|
}
|
|
|
|
task inline24(type: KonanLocalTest) {
|
|
enabled = false
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline24.kt"
|
|
}
|
|
|
|
task inline25(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline25.kt"
|
|
}
|
|
|
|
task inline26(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/inline26.kt"
|
|
}
|
|
|
|
task inline_type_substitution_in_fake_override(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/typeSubstitutionInFakeOverride.kt"
|
|
}
|
|
|
|
task inline_localFunctionInInitializerBlock(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/localFunctionInInitializerBlock.kt"
|
|
}
|
|
|
|
task inline_lambdaInDefaultValue(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/lambdaInDefaultValue.kt"
|
|
}
|
|
|
|
task inline_lambdaAsAny(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/lambdaAsAny.kt"
|
|
}
|
|
|
|
task inline_getClass(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/getClass.kt"
|
|
}
|
|
|
|
task inline_statementAsLastExprInBlock(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/statementAsLastExprInBlock.kt"
|
|
}
|
|
|
|
task inline_returnLocalClassFromBlock(type: KonanLocalTest) {
|
|
enabled = false
|
|
useGoldenData = true
|
|
source = "codegen/inline/returnLocalClassFromBlock.kt"
|
|
}
|
|
|
|
task inline_changingCapturedLocal(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/changingCapturedLocal.kt"
|
|
}
|
|
|
|
task inline_defaultArgs(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/defaultArgs.kt"
|
|
}
|
|
|
|
task inline_propertyAccessorInline(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/propertyAccessorInline.kt"
|
|
}
|
|
|
|
task inline_twiceInlinedObject(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/twiceInlinedObject.kt"
|
|
}
|
|
|
|
task inline_localObjectReturnedFromWhen(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/localObjectReturnedFromWhen.kt"
|
|
}
|
|
|
|
task inline_genericFunctionReference(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/genericFunctionReference.kt"
|
|
}
|
|
|
|
task inline_correctOrderFunctionReference(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/correctOrderFunctionReference.kt"
|
|
}
|
|
|
|
task inline_coercionToUnit(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/inline/coercionToUnit.kt"
|
|
}
|
|
|
|
task inline_redundantCoercionsCleaner(type: KonanLocalTest) {
|
|
source = "codegen/inline/redundantCoercionsCleaner.kt"
|
|
}
|
|
|
|
task classDeclarationInsideInline(type: KonanLocalTest) {
|
|
source = "codegen/inline/classDeclarationInsideInline.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
task inlineClass0(type: KonanLocalTest) {
|
|
source = "codegen/inlineClass/inlineClass0.kt"
|
|
}
|
|
|
|
task inlineClass_customEquals(type: KonanLocalTest) {
|
|
source = "codegen/inlineClass/customEquals.kt"
|
|
}
|
|
|
|
task inlineClass_defaultEquals(type: KonanLocalTest) {
|
|
source = "codegen/inlineClass/defaultEquals.kt"
|
|
}
|
|
|
|
task inlineClass_secondaryConstructorWithGenerics(type: KonanLocalTest) {
|
|
source = "codegen/inlineClass/secondaryConstructorWithGenerics.kt"
|
|
}
|
|
|
|
task inlineClass_nestedInlineClasses(type: KonanLocalTest) {
|
|
source = "codegen/inlineClass/nestedInlineClasses.kt"
|
|
}
|
|
|
|
task valueClass0(type: KonanLocalTest) {
|
|
source = "codegen/inlineClass/valueClass0.kt"
|
|
}
|
|
|
|
task deserialized_inline0(type: KonanLocalTest) {
|
|
source = "serialization/deserialized_inline0.kt"
|
|
}
|
|
|
|
task deserialized_listof0(type: KonanLocalTest) {
|
|
source = "serialization/deserialized_listof0.kt"
|
|
}
|
|
|
|
task deserialized_fields(type: KonanLocalTest) {
|
|
source = "serialization/deserialized_fields.kt"
|
|
}
|
|
|
|
KotlinNativeTestKt.createTest(project, "kt39548", KonanStandaloneTest) { task ->
|
|
// Test infrastructure doesn't support generated source;
|
|
// workaround by specifying dummy source:
|
|
task.source = "does/not/exist/kt39548.dummy.kt"
|
|
task.enabled = isWindowsTarget(project)
|
|
|
|
if (task.enabled) {
|
|
konanArtifacts {
|
|
program(name, targets: [target.name]) {
|
|
baseDir "$testOutputLocal/$name"
|
|
srcFiles "$buildDir/kt39548/kt39548.kt" // Generated by doBeforeBuild task.
|
|
extraOpts task.flags
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
doBeforeBuild {
|
|
GenTestKT39548Kt.genTestKT39548(file("$buildDir/kt39548/kt39548.kt"))
|
|
}
|
|
}
|
|
}
|
|
|
|
linkTest("deserialized_members") {
|
|
source = "serialization/deserialized_members/main.kt"
|
|
lib = "serialization/deserialized_members/library.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
linkTest("serialized_catch") {
|
|
source = "serialization/serialized_catch/main.kt"
|
|
lib = "serialization/serialized_catch/library.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
linkTest("serialized_doWhile") {
|
|
source = "serialization/serialized_doWhile/main.kt"
|
|
lib = "serialization/serialized_doWhile/library.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
linkTest("serialized_vararg") {
|
|
source = "serialization/serialized_vararg/main.kt"
|
|
lib = "serialization/serialized_vararg/library.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
linkTest("serialized_default_args") {
|
|
source = "serialization/serialized_default_args/main.kt"
|
|
lib = "serialization/serialized_default_args/library.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("serialized_no_typemap") {
|
|
source = "serialization/regression/no_type_map.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
linkTest("serialized_enum_ordinal") {
|
|
source = "serialization/enum_ordinal/main.kt"
|
|
lib = "serialization/enum_ordinal/library.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
linkTest("serialized_char_constant") {
|
|
source = "serialization/serialized_char_constant/main.kt"
|
|
lib = "serialization/serialized_char_constant/library.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("testing_annotations") {
|
|
source = "testing/annotations.kt"
|
|
flags = ['-tr']
|
|
arguments = ['--ktest_logger=SIMPLE']
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("testing_assertions") {
|
|
source = "testing/assertions.kt"
|
|
flags = ['-tr']
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
expectedExitStatus = 0
|
|
}
|
|
|
|
standaloneTest("testing_custom_main") {
|
|
source = "testing/custom_main.kt"
|
|
flags = ['-tr', '-e', 'kotlin.test.tests.main']
|
|
arguments = ['--ktest_logger=SIMPLE', '--ktest_repeat=2']
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("testing_library_usage") {
|
|
def target = project.testTarget ?: 'host'
|
|
dependsOn konanArtifacts.baseTestClass.getByTarget(target)
|
|
def klib = konanArtifacts.baseTestClass.getArtifactByTarget(target)
|
|
source = 'testing/library_user.kt'
|
|
flags = ['-tr', '-e', 'main', '-l', klib.absolutePath]
|
|
arguments = ['--ktest_logger=SILENT']
|
|
}
|
|
|
|
class Filter {
|
|
List<String> positive
|
|
List<String> negative
|
|
List<String> expectedTests
|
|
|
|
Filter(List<String> positive, List<String> negative, List<String> expectedTests) {
|
|
this.positive = positive
|
|
this.negative = negative
|
|
this.expectedTests = expectedTests
|
|
}
|
|
|
|
List<String> args() {
|
|
List<String> result = []
|
|
if (positive != null && !positive.isEmpty()) {
|
|
result += "--ktest_gradle_filter=${asListOfPatterns(positive)}"
|
|
}
|
|
if (negative != null && !negative.isEmpty()) {
|
|
result += "--ktest_negative_gradle_filter=${asListOfPatterns(negative)}"
|
|
}
|
|
return result
|
|
}
|
|
|
|
static private String asListOfPatterns(List<String> input) {
|
|
return input.collect { "kotlin.test.tests.$it" }.join(",")
|
|
}
|
|
}
|
|
|
|
standaloneTest("testing_filters") {
|
|
source = "testing/filters.kt"
|
|
flags = ['-tr', '-ea']
|
|
def filters = [
|
|
new Filter(["A.foo1", "B", "FiltersKt.foo1"], [], ["A.foo1", "B.foo1", "B.foo2", "B.bar", "FiltersKt.foo1"]),
|
|
new Filter([], ["A.foo1", "B", "FiltersKt.foo1"], ["A.foo2", "A.bar", "FiltersKt.foo2", "FiltersKt.bar"]),
|
|
new Filter(["A", "FiltersKt"], ["A.foo1", "FiltersKt.foo1"], ["A.foo2", "A.bar", "FiltersKt.foo2", "FiltersKt.bar"]),
|
|
new Filter(["A.foo*", "B.*"], [], ["A.foo1", "A.foo2", "B.foo1", "B.foo2", "B.bar"]),
|
|
new Filter([], ["A.foo*", "B.*"], ["A.bar", "FiltersKt.foo1", "FiltersKt.foo2", "FiltersKt.bar"]),
|
|
new Filter(["*.foo*"], ["B"], ["A.foo1", "A.foo2", "FiltersKt.foo1", "FiltersKt.foo2"]),
|
|
new Filter(["A"], ["*.foo*"], ["A.bar"])
|
|
]
|
|
multiRuns = true
|
|
multiArguments = filters.collect { it.args() + '--ktest_logger=SIMPLE' }
|
|
outputChecker = { String output ->
|
|
// The first chunk is empty - drop it.
|
|
def outputs = output.split("Starting testing\n").drop(1)
|
|
if (outputs.size() != filters.size()) {
|
|
println("Incorrect number of test runs. Expected: ${filters.size()}, actual: ${outputs.size()}")
|
|
return false
|
|
}
|
|
|
|
// Check the correct set of tests was executed in each run.
|
|
for (int i = 0; i < outputs.size(); i++) {
|
|
def actualMessages = outputs[i].split('\n').findAll { it.startsWith("Passed: ") }
|
|
def expectedMessages = filters[i].expectedTests.collect { String test ->
|
|
def method = test.substring(test.lastIndexOf('.') + 1)
|
|
def suite = test.substring(0, test.lastIndexOf('.'))
|
|
"Passed: $method (kotlin.test.tests.$suite)".toString()
|
|
}
|
|
|
|
if (actualMessages.size() != expectedMessages.size()) {
|
|
println("Incorrect number of tests executed for filters[$i]. Expected: ${expectedMessages.size()}. Actual: ${actualMessages.size()}")
|
|
return false
|
|
}
|
|
|
|
for (message in expectedMessages) {
|
|
if (!actualMessages.contains(message)) {
|
|
println("Test run output for filters[$i] doesn't contain the expected message '$message'")
|
|
return false
|
|
}
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
}
|
|
|
|
standaloneTest("testing_filtered_suites") {
|
|
source = "testing/filtered_suites.kt"
|
|
flags = ["-tr", "-ea"]
|
|
|
|
def filters = [
|
|
["Filtered_suitesKt.*"], // filter out a class.
|
|
["A.*"], // filter out a top-level suite.
|
|
["*.common"], // run a test from all suites -> all hooks executed.
|
|
["Ignored.*"], // an ignored suite -> no hooks executed.
|
|
["A.ignored"] // a suite with only ignored tests -> no hooks executed.
|
|
]
|
|
def expectedHooks = [
|
|
["Filtered_suitesKt.before", "Filtered_suitesKt.after"],
|
|
["A.before", "A.after"],
|
|
["A.before", "A.after", "Filtered_suitesKt.before", "Filtered_suitesKt.after"],
|
|
[],
|
|
[]
|
|
]
|
|
|
|
multiRuns = true
|
|
multiArguments = filters.collect {
|
|
def filter = it.collect { "kotlin.test.tests.$it" }.join(",")
|
|
["--ktest_gradle_filter=$filter", "--ktest_logger=SIMPLE"]
|
|
}
|
|
outputChecker = { String output ->
|
|
// The first chunk is empty - drop it.
|
|
def outputs = output.split("Starting testing\n").drop(1)
|
|
if (outputs.size() != expectedHooks.size()) {
|
|
println("Incorrect number of test runs. Expected: ${expectedHooks.size()}, actual: ${outputs.size()}")
|
|
return false
|
|
}
|
|
|
|
// Check the correct set of hooks was executed on each run.
|
|
for (int i = 0; i < outputs.size(); i++) {
|
|
def actual = outputs[i].split('\n')
|
|
.findAll { it.startsWith("Hook:") }
|
|
.collect { it.replace("Hook: ", "") }
|
|
def expected = expectedHooks[i]
|
|
|
|
if (actual.size() != expected.size()) {
|
|
println("Incorrect number of executed hooks for run #$i. Expected: ${expected.size()}. Actual: ${actual.size()}")
|
|
println("Expected hooks: $expected")
|
|
println("Actual hooks: $actual")
|
|
return false
|
|
}
|
|
|
|
for (expectedHook in expected) {
|
|
if (!actual.contains(expectedHook)) {
|
|
println("Expected hook wasn't executed for run #$i: $expectedHook")
|
|
println("Expected hooks: $expected")
|
|
println("Actual hooks: $actual")
|
|
return false
|
|
}
|
|
}
|
|
}
|
|
return true
|
|
}
|
|
}
|
|
|
|
// Check that stacktraces and ignored suite are correctly reported in the TC logger.
|
|
standaloneTest("testing_stacktrace") {
|
|
source = "testing/stacktrace.kt"
|
|
flags = ['-tr', '-ea']
|
|
arguments = ["--ktest_logger=TEAMCITY", "--ktest_no_exit_code"]
|
|
expectedFail = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
// This test prints TeamCity service messages about failed test causing false negative failure at CI.
|
|
// So we need to suppress printing these messages to stdout.
|
|
// printOutput = false
|
|
outputChecker = { String output ->
|
|
def ignoredOutput = """\
|
|
|##teamcity[testSuiteStarted name='kotlin.test.tests.Ignored' locationHint='ktest:suite://kotlin.test.tests.Ignored']
|
|
|##teamcity[testIgnored name='foo']
|
|
|##teamcity[testSuiteFinished name='kotlin.test.tests.Ignored']""".stripMargin()
|
|
def failedOutput = """\
|
|
|##teamcity[testSuiteStarted name='kotlin.test.tests.Failed' locationHint='ktest:suite://kotlin.test.tests.Failed']
|
|
|##teamcity[testStarted name='bar' locationHint='ktest:test://kotlin.test.tests.Failed.bar']
|
|
|##teamcity[testFailed name='bar' message='Bar' details='kotlin.Exception: Bar|n""".stripMargin()
|
|
|
|
def shownInnerException = output.readLines()
|
|
.find { it.startsWith("##teamcity[testFailed name='bar'") }
|
|
?.contains("Caused by: kotlin.Exception: Baz") ?: false
|
|
|
|
return output.contains(ignoredOutput) && output.contains(failedOutput) && shownInnerException
|
|
}
|
|
}
|
|
|
|
// Just check that the driver is able to produce runnable binaries.
|
|
tasks.register("driver0", KonanDriverTest) {
|
|
disabled = isAggressiveGC // No need to test with different GC schedulers
|
|
|| isK2(project) // KT-56855
|
|
useGoldenData = true
|
|
source = "runtime/basic/driver0.kt"
|
|
}
|
|
|
|
tasks.register("driver_opt", KonanDriverTest) {
|
|
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
|
|
|| isK2(project) // KT-56855
|
|
|| isAggressiveGC // No need to test with different GC schedulers
|
|
useGoldenData = true
|
|
source = "runtime/basic/driver_opt.kt"
|
|
flags = ["-opt"]
|
|
}
|
|
|
|
// Enable when deserialization for default arguments is fixed.
|
|
linkTest("inline_defaultArgs_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/inline/defaultArgs_linkTest_main.kt"
|
|
lib = "codegen/inline/defaultArgs_linkTest_lib.kt"
|
|
}
|
|
|
|
linkTest("inline_sharedVar_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/inline/sharedVar_linkTest_main.kt"
|
|
lib = "codegen/inline/sharedVar_linkTest_lib.kt"
|
|
}
|
|
|
|
linkTest("inline_lateinitProperty_linkTest") {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
useGoldenData = true
|
|
source = "codegen/inline/lateinitProperty_linkTest_main.kt"
|
|
lib = "codegen/inline/lateinitProperty_linkTest_lib.kt"
|
|
}
|
|
|
|
linkTest("inline_inlineCtor_linkTest") {
|
|
source = "codegen/inline/inlineCtor_linkTest_main.kt"
|
|
lib = "codegen/inline/inlineCtor_linkTest_lib.kt"
|
|
}
|
|
|
|
linkTest("inline_innerInlineFunCapturesOuter_linkTest") {
|
|
useGoldenData = true
|
|
source = "codegen/inline/innerInlineFunCapturesOuter_linkTest_main.kt"
|
|
lib = "codegen/inline/innerInlineFunCapturesOuter_linkTest_lib.kt"
|
|
}
|
|
|
|
def generateWithSpaceDefFile() {
|
|
def mapOption = "--Map \"${buildDir}/cutom map.map\""
|
|
if (isAppleTarget(project)) {
|
|
mapOption = "-map \"${buildDir}/cutom map.map\""
|
|
} else if (isWindowsTarget(project)) {
|
|
mapOption = "\"-Wl,--Map,${buildDir}/cutom map.map\""
|
|
}
|
|
|
|
buildDir.mkdirs()
|
|
def file = new File("${buildDir}/withSpaces.def")
|
|
file.write """
|
|
headers = stdio.h "${projectDir}/interop/basics/custom headers/custom.h"
|
|
linkerOpts = $mapOption
|
|
---
|
|
|
|
int customCompare(const char* str1, const char* str2) {
|
|
return custom_strcmp(str1, str2);
|
|
}
|
|
"""
|
|
return file.absolutePath
|
|
}
|
|
|
|
// A helper method to create interop artifacts
|
|
void createInterop(String name, Closure conf) {
|
|
konanArtifacts {
|
|
interop(name, targets: [target.name]) {
|
|
conf(it)
|
|
noDefaultLibs(true)
|
|
noEndorsedLibs(true)
|
|
baseDir "$testOutputLocal/$name"
|
|
}
|
|
}
|
|
}
|
|
|
|
createInterop("sysstat") {
|
|
// FIXME: creates empty file to workaround konan gradle plugin issue (should be able to have no def file)
|
|
def f = File.createTempFile("sysstat.empty", ".def")
|
|
it.packageName 'sysstat'
|
|
// FIXME: this option doesn't work due to an issue in plugin: it tries to resolve header in project dir.
|
|
//it.headers 'sys/stat.h'
|
|
f.write("headers = sys/stat.h")
|
|
it.defFile f
|
|
}
|
|
|
|
createInterop("cstdlib") {
|
|
it.defFile 'interop/basics/cstdlib.def'
|
|
}
|
|
|
|
createInterop("cstdio") {
|
|
it.defFile 'interop/basics/cstdio.def'
|
|
}
|
|
|
|
createInterop("sockets") {
|
|
it.defFile 'interop/basics/sockets.def'
|
|
}
|
|
|
|
createInterop("bitfields") {
|
|
it.defFile 'interop/basics/bitfields.def'
|
|
}
|
|
|
|
createInterop("cglobals") {
|
|
it.defFile 'interop/basics/cglobals.def'
|
|
}
|
|
|
|
createInterop("cfunptr") {
|
|
it.defFile 'interop/basics/cfunptr.def'
|
|
}
|
|
|
|
createInterop("cmacros") {
|
|
it.defFile 'interop/basics/cmacros.def'
|
|
}
|
|
|
|
createInterop("cunsupported") {
|
|
it.defFile 'interop/basics/cunsupported.def'
|
|
}
|
|
|
|
createInterop("ctoKString") {
|
|
it.defFile 'interop/basics/ctoKString.def'
|
|
}
|
|
|
|
createInterop("ctypes") {
|
|
it.defFile 'interop/basics/ctypes.def'
|
|
}
|
|
|
|
createInterop("structAnonym") {
|
|
it.defFile 'interop/basics/structAnonym.def'
|
|
}
|
|
|
|
createInterop("cvalues") {
|
|
it.defFile 'interop/basics/cvalues.def'
|
|
}
|
|
|
|
createInterop("cvectors") {
|
|
it.defFile 'interop/basics/cvectors.def'
|
|
}
|
|
|
|
createInterop("cstructs") {
|
|
it.defFile 'interop/basics/cstructs.def'
|
|
}
|
|
|
|
createInterop("ccallbacksAndVarargs") {
|
|
it.defFile 'interop/basics/ccallbacksAndVarargs.def'
|
|
}
|
|
|
|
createInterop("cmangling") {
|
|
it.defFile 'interop/basics/mangling.def'
|
|
}
|
|
|
|
createInterop("cmangling2") {
|
|
it.defFile 'interop/basics/mangling2.def'
|
|
}
|
|
|
|
createInterop("cmangling_keywords") {
|
|
it.defFile 'interop/basics/mangling_keywords.def'
|
|
}
|
|
|
|
createInterop("cmangling_keywords2") {
|
|
it.defFile 'interop/basics/mangling_keywords2.def'
|
|
}
|
|
|
|
createInterop("cunion") {
|
|
it.defFile 'interop/basics/cunion.def'
|
|
}
|
|
|
|
createInterop("cenums") {
|
|
it.defFile 'interop/basics/cenums.def'
|
|
}
|
|
|
|
createInterop("carrayPointers") {
|
|
it.defFile 'interop/basics/carrayPointers.def'
|
|
}
|
|
|
|
createInterop("auxiliaryCppSources") {
|
|
// We need to provide empty def file to create correct `KonanInteropTask`.
|
|
it.defFile 'interop/auxiliary_sources/auxiliaryCppSources.def'
|
|
it.headers "$projectDir/interop/auxiliary_sources/name.h"
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/auxiliary_sources/name.cpp"
|
|
it.extraOpts "-Xsource-compiler-option", "-std=c++17"
|
|
}
|
|
|
|
createInterop("concurrentTerminate") {
|
|
it.defFile 'interop/concurrentTerminate/concurrentTerminate.def'
|
|
it.headers "$projectDir/interop/concurrentTerminate/async.h"
|
|
// TODO: Using `-Xcompile-source` does not imply dependency on that source, so the task will no re-run when the source is updated.
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/concurrentTerminate/async.cpp"
|
|
it.extraOpts "-Xsource-compiler-option", "-std=c++17"
|
|
}
|
|
|
|
createInterop("incomplete_types") {
|
|
it.defFile 'interop/incomplete_types/library.def'
|
|
it.headers "$projectDir/interop/incomplete_types/library.h"
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/incomplete_types/library.cpp"
|
|
}
|
|
|
|
createInterop("embedStaticLibraries") {
|
|
it.defFile 'interop/embedStaticLibraries/embedStaticLibraries.def'
|
|
it.headers "$projectDir/interop/embedStaticLibraries/embedStaticLibraries.h"
|
|
|
|
// Note: also hardcoded in def file.
|
|
final String libDir = "$buildDir/embedStaticLibraries/"
|
|
|
|
it.getByTarget(target.name).configure {
|
|
doFirst {
|
|
1.upto(4) {
|
|
UtilsKt.buildStaticLibrary(
|
|
project,
|
|
[file("$projectDir/interop/embedStaticLibraries/${it}.c")],
|
|
file("$libDir/${it}.a"),
|
|
file("$libDir/${it}.objs"),
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
it.extraOpts '-staticLibrary', "1.a"
|
|
it.extraOpts '-staticLibrary', "2.a"
|
|
}
|
|
|
|
createInterop("kt43265") {
|
|
it.defFile 'interop/kt43265/kt43265.def'
|
|
}
|
|
|
|
createInterop("kt44283") {
|
|
it.defFile 'interop/kt44283/kt44283.def'
|
|
}
|
|
|
|
createInterop("kt51925") {
|
|
it.defFile 'interop/kt51925/kt51925.def'
|
|
}
|
|
|
|
createInterop("kt54284") {
|
|
it.defFile 'interop/kt54284/kt54284.def'
|
|
}
|
|
|
|
createInterop("kt54284_fmodules") {
|
|
it.defFile 'interop/kt54284/kt54284.def'
|
|
it.extraOpts '-compiler-option', '-fmodules'
|
|
}
|
|
|
|
createInterop("kt43502") {
|
|
it.defFile 'interop/kt43502/kt43502.def'
|
|
it.headers "$projectDir/interop/kt43502/kt43502.h"
|
|
// Note: also hardcoded in def file.
|
|
final String libDir = "$buildDir/kt43502/"
|
|
// Construct library that contains actual symbol definition.
|
|
it.getByTarget(target.name).configure {
|
|
doFirst {
|
|
UtilsKt.buildStaticLibrary(
|
|
project,
|
|
[file("$projectDir/interop/kt43502/kt43502.c")],
|
|
file("$libDir/kt43502.a"),
|
|
file("$libDir/kt43502.objs"),
|
|
)
|
|
}
|
|
}
|
|
}
|
|
|
|
createInterop("leakMemoryWithRunningThread") {
|
|
it.defFile 'interop/leakMemoryWithRunningThread/leakMemory.def'
|
|
it.headers "$projectDir/interop/leakMemoryWithRunningThread/leakMemory.h"
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/leakMemoryWithRunningThread/leakMemory.cpp"
|
|
}
|
|
|
|
createInterop("cppClass") {
|
|
it.defFile 'interop/cpp/cppClass.def'
|
|
}
|
|
|
|
createInterop("cppTypes") {
|
|
it.defFile 'interop/cpp/types.def'
|
|
}
|
|
|
|
createInterop("cppSkia") {
|
|
it.defFile 'interop/cpp/skia.def'
|
|
}
|
|
|
|
createInterop("cppSkiaSignature") {
|
|
it.defFile 'interop/cpp/skiaSignature.def'
|
|
}
|
|
|
|
createInterop("threadStates") {
|
|
it.defFile "interop/threadStates/threadStates.def"
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/threadStates/threadStates.cpp"
|
|
}
|
|
|
|
createInterop("workerSignals") {
|
|
it.defFile "interop/workerSignals/workerSignals.def"
|
|
it.headers "$projectDir/interop/workerSignals/workerSignals.h"
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/workerSignals/workerSignals.cpp"
|
|
}
|
|
|
|
createInterop("cForwardDeclarations") {
|
|
it.defFile "interop/forwardDeclarations/cForwardDeclarations.def"
|
|
}
|
|
|
|
createInterop("cForwardDeclarationsTwoLibs1") {
|
|
it.defFile "interop/forwardDeclarationsTwoLibs/cForwardDeclarationsTwoLibs1.def"
|
|
}
|
|
|
|
createInterop("cForwardDeclarationsTwoLibs2") {
|
|
it.defFile "interop/forwardDeclarationsTwoLibs/cForwardDeclarationsTwoLibs2.def"
|
|
}
|
|
|
|
if (PlatformInfo.isAppleTarget(project)) {
|
|
createInterop("objcSmoke") {
|
|
it.defFile 'interop/objc/objcSmoke.def'
|
|
it.headers "$projectDir/interop/objc/smoke.h"
|
|
}
|
|
|
|
createInterop("objcTests") {
|
|
it.defFile 'interop/objc/objcTests.def'
|
|
it.headers fileTree("$projectDir/interop/objc/tests") { include '**/*.h' }
|
|
}
|
|
|
|
createInterop("objcMisc") {
|
|
it.defFile 'interop/objc_with_initializer/objc_misc.def'
|
|
it.headers "$projectDir/interop/objc_with_initializer/objc_misc.h"
|
|
}
|
|
|
|
createInterop("objcMessaging") {
|
|
it.defFile 'interop/objc/msg_send/messaging.def'
|
|
it.headers "$projectDir/interop/objc/msg_send/messaging.h"
|
|
}
|
|
|
|
createInterop("objcDirect") {
|
|
it.defFile 'interop/objc/direct/direct.def'
|
|
it.headers "$projectDir/interop/objc/direct/direct.h"
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/objc/direct/direct.m", "-Xsource-compiler-option", "-DNS_FORMAT_ARGUMENT(A)="
|
|
it.compilerOpts '-DNS_FORMAT_ARGUMENT(A)='
|
|
}
|
|
|
|
createInterop("foreignException") {
|
|
it.defFile 'interop/objc/foreignException/objc_wrap.def'
|
|
it.headers "$projectDir/interop/objc/foreignException/objc_wrap.h"
|
|
}
|
|
|
|
createInterop("foreignExceptionMode_default") {
|
|
it.defFile 'interop/objc/foreignException/objcExceptionMode.def'
|
|
it.headers "$projectDir/interop/objc/foreignException/objc_wrap.h"
|
|
}
|
|
|
|
createInterop("foreignExceptionMode_wrap") {
|
|
it.defFile 'interop/objc/foreignException/objcExceptionMode.def'
|
|
it.headers "$projectDir/interop/objc/foreignException/objc_wrap.h"
|
|
it.extraOpts '-Xforeign-exception-mode', "objc-wrap"
|
|
}
|
|
|
|
createInterop("objcKt34467") {
|
|
it.defFile 'interop/objc/kt34467/module_library.def'
|
|
def moduleMap = file("interop/objc/kt34467/module_library.modulemap").absolutePath
|
|
def includePath = file("interop/objc/kt34467").absolutePath
|
|
it.compilerOpts "-fmodule-map-file=$moduleMap", "-I$includePath"
|
|
}
|
|
createInterop("objcGh3343") {
|
|
it.defFile 'framework/gh3343/objclib.def'
|
|
it.headers "$projectDir/framework/gh3343/objclib.h"
|
|
it.linkerOpts "-lobjcgh3343"
|
|
}
|
|
createInterop("objc_illegal_sharing_with_weak") {
|
|
it.defFile 'interop/objc/illegal_sharing_with_weak/objclib.def'
|
|
it.headers "$projectDir/interop/objc/illegal_sharing_with_weak/objclib.h"
|
|
}
|
|
createInterop("objcKt43517") {
|
|
it.defFile 'framework/kt43517/kt43517.def'
|
|
}
|
|
createInterop("objc_kt42172") {
|
|
it.defFile 'interop/objc/kt42172/objclib.def'
|
|
it.headers "$projectDir/interop/objc/kt42172/objclib.h"
|
|
}
|
|
createInterop("objc_kt48816") {
|
|
it.defFile 'interop/objc/kt48816/objclib.def'
|
|
it.headers "$projectDir/interop/objc/kt48816/objclib.h"
|
|
}
|
|
createInterop("objc_kt50648") {
|
|
it.defFile 'interop/objc/kt50648/objclib.def'
|
|
}
|
|
createInterop("objc_kt53151") {
|
|
it.defFile 'interop/objc/kt53151/objclib.def'
|
|
it.compilerOpts "-F$projectDir/interop/objc/kt53151/testFramework"
|
|
}
|
|
createInterop("objc_kt55938") {
|
|
it.defFile 'interop/objc/kt55938/objclib.def'
|
|
it.headers "$projectDir/interop/objc/kt55938/objclib.h"
|
|
}
|
|
|
|
createInterop("kt49034_struct") {
|
|
it.defFile 'interop/objc/kt49034/struct/kt49034.def'
|
|
it.headers "$projectDir/interop/objc/kt49034/struct/kt49034.h"
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/objc/kt49034/struct/impl.c"
|
|
}
|
|
|
|
createInterop("kt49034_objcclass") {
|
|
it.defFile 'interop/objc/kt49034/objcclass/kt49034.def'
|
|
it.headers "$projectDir/interop/objc/kt49034/objcclass/kt49034.h"
|
|
}
|
|
createInterop("kt49034_objcprotocol") {
|
|
it.defFile 'interop/objc/kt49034/objcprotocol/kt49034.def'
|
|
it.headers "$projectDir/interop/objc/kt49034/objcprotocol/kt49034.h"
|
|
}
|
|
createInterop("objc_include_categories") {
|
|
it.defFile 'interop/objc/include_categories/objc_include_categories.def'
|
|
it.headers "$projectDir/interop/objc/include_categories/objc_include_categories.h"
|
|
}
|
|
createInterop("frameworkForwardDeclarations") {
|
|
it.defFile 'framework/forwardDeclarations/clib.def'
|
|
}
|
|
createInterop("objc_kt56402") {
|
|
it.defFile 'interop/objc/kt56402/objclib.def'
|
|
it.headers "$projectDir/interop/objc/kt56402/objclib.h"
|
|
}
|
|
}
|
|
|
|
createInterop("withSpaces") {
|
|
it.defFile generateWithSpaceDefFile()
|
|
}
|
|
|
|
createInterop("exceptions_throwThroughBridge") {
|
|
it.defFile "interop/exceptions/throwThroughBridge.def"
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/exceptions/throwThroughBridgeInterop.cpp"
|
|
}
|
|
|
|
createInterop("exceptions_cCallback") {
|
|
it.defFile "interop/exceptions/cCallback.def"
|
|
it.extraOpts "-Xcompile-source", "$projectDir/interop/exceptions/cCallback.cpp"
|
|
}
|
|
|
|
/**
|
|
* Creates a task for the interop test. Configures runner and adds library and test build tasks.
|
|
*/
|
|
Task interopTestBase(String name, boolean multiFile, Closure<KonanInteropTest> configureClosure) {
|
|
return KotlinNativeTestKt.createTest(project, name, KonanInteropTest) { task ->
|
|
task.configure(configureClosure)
|
|
if (task.enabled) {
|
|
konanArtifacts {
|
|
def targetName = target.name
|
|
def interopLib = task.interop
|
|
def interopLib2 = task.interop2
|
|
UtilsKt.dependsOnKonanBuildingTask(task, interopLib, target)
|
|
if (interopLib2 != null) UtilsKt.dependsOnKonanBuildingTask(task, interopLib2, target)
|
|
|
|
def lib = "lib$name"
|
|
def hasIntermediateLib = task.lib != null
|
|
if (hasIntermediateLib) {
|
|
// build a library from KonanLinkTest::lib property
|
|
library(lib, targets: [targetName]) {
|
|
libraries {
|
|
artifact interopLib
|
|
if (interopLib2 != null) artifact interopLib2
|
|
}
|
|
srcFiles task.lib
|
|
baseDir "$testOutputLocal/$name"
|
|
extraOpts task.flags
|
|
extraOpts project.globalTestArgs.findAll { !it.contains("-Xpartial-linkage") }
|
|
}
|
|
UtilsKt.dependsOnKonanBuildingTask(task, lib, target)
|
|
}
|
|
|
|
program(name, targets: [targetName]) {
|
|
libraries {
|
|
artifact interopLib
|
|
if (interopLib2 != null) artifact interopLib2
|
|
if (hasIntermediateLib)
|
|
klib lib
|
|
}
|
|
srcFiles multiFile ? fileTree(task.source) { include '**/*.kt' } : task.getSources()
|
|
baseDir "$testOutputLocal/$name"
|
|
linkerOpts "-L$buildDir"
|
|
extraOpts task.flags
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Task interopTest(String name, Closure<KonanInteropTest> configureClosure) {
|
|
return interopTestBase(name, false, configureClosure)
|
|
}
|
|
|
|
Task interopTestMultifile(String name, Closure<KonanInteropTest> configureClosure) {
|
|
return interopTestBase(name, true, configureClosure)
|
|
}
|
|
|
|
standaloneTest("interop_objc_allocException") {
|
|
disabled = !isAppleTarget(project)
|
|
expectedExitStatus = 0
|
|
source = "interop/objc/allocException.kt"
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
interopTest("interop_available_processors") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = 'interop/basics/available_processors.kt'
|
|
arguments = [Runtime.getRuntime().availableProcessors().toString()]
|
|
interop = 'cstdlib'
|
|
}
|
|
|
|
interopTest("interop0") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
(project.testTarget == 'linux_mips32') || // st_uid of '/' is not equal to 0 when using qemu
|
|
(project.testTarget == 'linux_mipsel32') ||
|
|
(project.testTarget == 'linux_arm32_hfp') ||
|
|
(project.testTarget == 'linux_arm64')
|
|
useGoldenData = true
|
|
source = "interop/basics/0.kt"
|
|
interop = 'sysstat'
|
|
}
|
|
|
|
interopTest("interop1") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
useGoldenData = true
|
|
source = "interop/basics/1.kt"
|
|
interop = 'cstdlib'
|
|
}
|
|
|
|
interopTest("interop2") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
useGoldenData = true
|
|
source = "interop/basics/2.kt"
|
|
interop = 'cstdio'
|
|
}
|
|
|
|
interopTest("interop3") {
|
|
// We disable this test on Raspberry Pi because
|
|
// qsort accepts size_t args. So the .kt file
|
|
// should be different depending on the bitness of the target.
|
|
// There are plans to provide a solution and turn this
|
|
// test back on.
|
|
disabled = (project.testTarget == 'raspberrypi') ||
|
|
(project.testTarget == 'linux_mips32') ||
|
|
(project.testTarget == 'linux_mipsel32') ||
|
|
(project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
useGoldenData = true
|
|
source = "interop/basics/3.kt"
|
|
interop = 'cstdlib'
|
|
}
|
|
|
|
interopTest("interop4") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
useGoldenData = true
|
|
source = "interop/basics/4.kt"
|
|
interop = 'cstdio'
|
|
}
|
|
|
|
standaloneTest("interop5") {
|
|
enabled = (project.testTarget != 'wasm32') // No interop for wasm yet.
|
|
useGoldenData = true
|
|
source = "interop/basics/5.kt"
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
interopTest("interop_bitfields") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
|| isAggressiveGC // TODO: Investigate why too slow
|
|
expectedFail = (project.testTarget == 'linux_mips32') // fails because of big-endiannes
|
|
source = "interop/basics/bf.kt"
|
|
interop = 'bitfields'
|
|
}
|
|
|
|
interopTest("interop_funptr") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
useGoldenData = true
|
|
source = "interop/basics/funptr.kt"
|
|
interop = 'cfunptr'
|
|
}
|
|
|
|
interopTest("interop_globals") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/globals.kt"
|
|
interop = 'cglobals'
|
|
}
|
|
|
|
interopTest("interop_macros") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
isK2(project) // KT-56041
|
|
source = "interop/basics/macros.kt"
|
|
interop = 'cmacros'
|
|
}
|
|
|
|
interopTest("interop_unsupported") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/unsupported.kt"
|
|
interop = 'cunsupported'
|
|
}
|
|
|
|
interopTest("interop_toKString") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/toKString.kt"
|
|
interop = 'ctoKString'
|
|
}
|
|
|
|
interopTest("interop_types") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/types.kt"
|
|
interop = 'ctypes'
|
|
}
|
|
|
|
interopTest("interop_structAnonym") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
(project.testTarget == 'mingw_x86')
|
|
source = "interop/basics/structAnonym.kt"
|
|
interop = 'structAnonym'
|
|
}
|
|
|
|
interopTest("interop_vectors") {
|
|
disabled = (project.testTarget == 'wasm32') || (project.testTarget == 'linux_mips32') // No interop for wasm yet.
|
|
source = "interop/basics/vectors.kt"
|
|
interop = 'cvectors'
|
|
}
|
|
|
|
interopTest("interop_mangling") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/mangling.kt"
|
|
interop = 'cmangling'
|
|
}
|
|
|
|
interopTest("interop_mangling2") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/mangling2.kt"
|
|
interop = 'cmangling2'
|
|
}
|
|
|
|
interopTest("interop_mangling_keywords") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/mangling_keywords.kt"
|
|
interop = 'cmangling_keywords'
|
|
}
|
|
|
|
interopTest("interop_mangling_keywords2") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/mangling_keywords2.kt"
|
|
interop = 'cmangling_keywords2'
|
|
}
|
|
|
|
interopTest("interop_auxiliarySources") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/auxiliary_sources/main.kt"
|
|
interop = 'auxiliaryCppSources'
|
|
}
|
|
|
|
interopTest("interop_concurrentTerminate") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/concurrentTerminate/main.kt"
|
|
interop = 'concurrentTerminate'
|
|
outputChecker = { str -> str.endsWith("Reporting error!\n") }
|
|
expectedExitStatus = 99
|
|
}
|
|
|
|
interopTest("interop_incompleteTypes") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
isK2(project) // KT-56027
|
|
source = "interop/incomplete_types/main.kt"
|
|
interop = 'incomplete_types'
|
|
}
|
|
|
|
interopTest("interop_embedStaticLibraries") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/embedStaticLibraries/main.kt"
|
|
interop = 'embedStaticLibraries'
|
|
}
|
|
|
|
interopTest("interop_values") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/values.kt"
|
|
interop = 'cvalues'
|
|
}
|
|
|
|
interopTest("interop_structs") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/structs.kt"
|
|
interop = 'cstructs'
|
|
}
|
|
|
|
interopTest("interop_callbacksAndVarargs") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/basics/callbacksAndVarargs.kt"
|
|
interop = 'ccallbacksAndVarargs'
|
|
}
|
|
|
|
interopTest("interop_threadStates") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
!isExperimentalMM // No thread state switching in the legacy MM.
|
|
source = "interop/threadStates/threadStates.kt"
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
interop = "threadStates"
|
|
}
|
|
|
|
interopTest("interop_threadStates_callbacksWithExceptions") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
!isExperimentalMM // No thread state switching in the legacy MM.
|
|
source = "interop/threadStates/callbacksWithExceptions.kt"
|
|
interop = "threadStates"
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
interopTest("interop_threadStates_unhandledException") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
!isExperimentalMM // No thread state switching in the legacy MM.
|
|
source = "interop/threadStates/unhandledException.kt"
|
|
interop = "threadStates"
|
|
outputChecker = { it.contains("Error. Runnable state: true") }
|
|
expectedExitStatusChecker = { it != 0 }
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
interopTest("interop_threadStates_unhandledExceptionInForeignThread") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
!isExperimentalMM // No thread state switching in the legacy MM.
|
|
source = "interop/threadStates/unhandledExceptionInForeignThread.kt"
|
|
interop = "threadStates"
|
|
outputChecker = { it.contains("Error. Runnable state: true") }
|
|
expectedExitStatusChecker = { it != 0 }
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
interopTest("interop_withSpaces") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop ='withSpaces'
|
|
source = "interop/basics/withSpaces.kt"
|
|
|
|
doLast {
|
|
assert file("${buildDir}/cutom map.map").exists()
|
|
}
|
|
}
|
|
|
|
interopTest("interop_union") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop = 'cunion'
|
|
source = "interop/basics/union.kt"
|
|
}
|
|
|
|
interopTest("interop_enums") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop = 'cenums'
|
|
flags = ['-XXLanguage:+EnumEntries']
|
|
source = "interop/basics/enums.kt"
|
|
}
|
|
|
|
interopTest("interop_array_pointers") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop = 'carrayPointers'
|
|
source = "interop/basics/arrayPointers.kt"
|
|
}
|
|
|
|
interopTest("interop_kt43265") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop = 'kt43265'
|
|
source = "interop/kt43265/usage.kt"
|
|
}
|
|
|
|
interopTest("interop_kt44283") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
project.globalTestArgs.contains('-opt') // Incompatible with -g.
|
|
flags = ['-g']
|
|
interop = 'kt44283'
|
|
source = "interop/kt44283/main.kt"
|
|
}
|
|
|
|
interopTest("interop_kt54284") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop = 'kt54284'
|
|
source = "interop/kt54284/main.kt"
|
|
}
|
|
|
|
interopTest("interop_kt54284_fmodules") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop = 'kt54284_fmodules'
|
|
source = "interop/kt54284/main.kt"
|
|
}
|
|
|
|
// TODO: This test should be run with caches on.
|
|
interopTest("interop_kt51925") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop = 'kt51925'
|
|
lib = 'interop/kt51925/kt51925_lib.kt'
|
|
source = 'interop/kt51925/kt51925_main.kt'
|
|
useGoldenData = true
|
|
}
|
|
|
|
dynamicTest("interop_kt43502") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
interop = "kt43502"
|
|
source = "interop/kt43502/main.kt"
|
|
cSource = "$projectDir/interop/kt43502/main.c"
|
|
useGoldenData = true
|
|
}
|
|
|
|
interopTest("interop_leakMemoryWithRunningThreadUnchecked") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop = 'leakMemoryWithRunningThread'
|
|
source = "interop/leakMemoryWithRunningThread/unchecked.kt"
|
|
}
|
|
|
|
interopTest("interop_leakMemoryWithRunningThreadChecked") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
interop = 'leakMemoryWithRunningThread'
|
|
source = "interop/leakMemoryWithRunningThread/checked.kt"
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> s.contains("Cannot run checkers when there are 1 alive runtimes at the shutdown") }
|
|
}
|
|
|
|
standaloneTest("interop_pinning") {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions.
|
|
source = "interop/basics/pinning.kt"
|
|
flags = [ "-tr" ]
|
|
}
|
|
|
|
task interop_convert(type: KonanLocalTest) {
|
|
source = "codegen/intrinsics/interop_convert.kt"
|
|
}
|
|
|
|
task interop_sourceCodeStruct(type: KonanLocalTest) {
|
|
source = "codegen/intrinsics/interop_sourceCodeStruct.kt"
|
|
}
|
|
|
|
task interop_alloc_value(type: KonanLocalTest) {
|
|
source = "runtime/interop/interop_alloc_value.kt"
|
|
}
|
|
|
|
standaloneTest("isExperimentalMM") {
|
|
source = "codegen/intrinsics/isExperimentalMM.kt"
|
|
flags = [ "-tr" ]
|
|
}
|
|
|
|
interopTest("interop_cppClass") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/cpp/cppClass.kt"
|
|
interop = 'cppClass'
|
|
}
|
|
|
|
interopTest("interop_cppTypes") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/cpp/types.kt"
|
|
interop = 'cppTypes'
|
|
}
|
|
|
|
interopTest("interop_cppSkia") {
|
|
disabled = (project.testTarget == 'wasm32' || // No interop for wasm yet.
|
|
isExperimentalMM)
|
|
source = "interop/cpp/skia.kt"
|
|
interop = 'cppSkia'
|
|
useGoldenData = true
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
interopTest("interop_cppSkiaSignature") {
|
|
disabled = (project.testTarget == 'wasm32' || // No interop for wasm yet.
|
|
isK2(project)) // KT-57484
|
|
source = "interop/cpp/skiaSignature.kt"
|
|
interop = "cppSkiaSignature"
|
|
useGoldenData = true
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
interopTest("interop_workerSignals") {
|
|
disabled = (project.testTarget == 'wasm32') || // No interop for wasm yet.
|
|
(project.testTarget == 'mingw_x86' || project.testTarget == 'mingw_x64') // cross-thread signalling does not work on Windows
|
|
source = "interop/workerSignals/workerSignals.kt"
|
|
interop = "workerSignals"
|
|
}
|
|
|
|
interopTest("interop_forwardDeclarations") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/forwardDeclarations/forwardDeclarations.kt"
|
|
interop = "cForwardDeclarations"
|
|
}
|
|
|
|
interopTest("interop_forwardDeclarationsTwoLibs") {
|
|
disabled = (project.testTarget == 'wasm32') // No interop for wasm yet.
|
|
source = "interop/forwardDeclarationsTwoLibs/forwardDeclarationsTwoLibs.kt"
|
|
interop = "cForwardDeclarationsTwoLibs1"
|
|
interop2 = "cForwardDeclarationsTwoLibs2"
|
|
}
|
|
|
|
/*
|
|
TODO: This test isn't run automatically
|
|
task interop_echo_server(type: RunInteropKonanTest) {
|
|
disabled = isWasmTarget(project) || isWindowsTarget(project)
|
|
run = false
|
|
source = "interop/basics/echo_server.kt"
|
|
interop = 'sockets'
|
|
}
|
|
*/
|
|
|
|
/*
|
|
TODO: This test isn't run automatically
|
|
standaloneTest("interop_opengl_teapot") {
|
|
enabled = isAppleTarget(project) && project.testTarget != 'ios_x64' // No GLUT in iOS
|
|
dependsOnPlatformLibs(it as Task)
|
|
run = false
|
|
source = "interop/basics/opengl_teapot.kt"
|
|
}
|
|
*/
|
|
|
|
if (PlatformInfo.isAppleTarget(project)) {
|
|
interopTest("interop_objc_smoke") {
|
|
enabled = !isNoopGC
|
|
source = "interop/objc/smoke.kt"
|
|
interop = 'objcSmoke'
|
|
verifyIr = false // KT-57716
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/smoke.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcsmoke.dylib"
|
|
// Enable ARC optimizations to prevent some objects from leaking in Obj-C code due to exceptions:
|
|
args '-O2'
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjcsmoke.dylib")
|
|
}
|
|
|
|
copy {
|
|
from("interop/objc/Localizable.stringsdict")
|
|
into("$testOutputLocal/$name/$target/en.lproj/")
|
|
}
|
|
}
|
|
useGoldenData = true
|
|
}
|
|
|
|
interopTest("interop_objc_smoke_noopgc") {
|
|
enabled = isNoopGC
|
|
source = "interop/objc/smoke_noopgc.kt"
|
|
interop = 'objcSmoke'
|
|
verifyIr = false // KT-57716
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/smoke.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcsmoke.dylib"
|
|
// Enable ARC optimizations to prevent some objects from leaking in Obj-C code due to exceptions:
|
|
args '-O2'
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjcsmoke.dylib")
|
|
}
|
|
|
|
copy {
|
|
from("interop/objc/Localizable.stringsdict")
|
|
into("$testOutputLocal/$name/$target/en.lproj/")
|
|
}
|
|
}
|
|
// No deallocations for the no-op GC.
|
|
useGoldenData = true
|
|
}
|
|
|
|
interopTestMultifile("interop_objc_tests") {
|
|
disabled = isK2(project) // KT-57504
|
|
source = "interop/objc/tests/"
|
|
interop = 'objcTests'
|
|
flags = ['-tr', '-e', 'main']
|
|
|
|
if (isNoopGC) {
|
|
def exclude = [
|
|
"Kt41811Kt.*",
|
|
"CustomStringKt.testCustomString",
|
|
"Kt42482Kt.testKT42482",
|
|
"ObjcWeakRefsKt.testObjCWeakRef",
|
|
"WeakRefsKt.testWeakRefs"
|
|
]
|
|
arguments += ["--ktest_filter=*-${exclude.join(":")}"]
|
|
}
|
|
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args fileTree("$projectDir/interop/objc/tests/") { include '**/*.m' }
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjctests.dylib"
|
|
// Enable ARC optimizations to prevent some objects from leaking in Obj-C code due to exceptions:
|
|
args '-O2'
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjctests.dylib")
|
|
}
|
|
}
|
|
}
|
|
|
|
// KT-49034 tests don't need whole compilation pipeline (only frontend) or platform libraries. Consider simplifying them when porting
|
|
// to the new test infra.
|
|
interopTest("interop_kt49034_struct") {
|
|
disabled = (project.testTarget == 'wasm32')
|
|
interop = 'kt49034_struct'
|
|
source = 'interop/objc/kt49034/struct/main.kt'
|
|
|
|
// The test depends on collision between kt49034.JSContext and platform.JavaScriptCore.JSContext
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
interopTest("interop_kt49034_objcclass") {
|
|
disabled = (project.testTarget == 'wasm32')
|
|
interop = 'kt49034_objcclass'
|
|
source = 'interop/objc/kt49034/objcclass/main.kt'
|
|
|
|
// The test depends on collision between kt49034.__darwin_fp_control and platform.darwin.__darwin_fp_control
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
interopTest("interop_kt49034_objcprotocol") {
|
|
disabled = (project.testTarget == 'wasm32') || isK2(project) // KT-56028
|
|
interop = 'kt49034_objcprotocol'
|
|
source = 'interop/objc/kt49034/objcprotocol/main.kt'
|
|
|
|
// The test depends on collision between kt49034.__darwin_fp_control and platform.darwin.__darwin_fp_control
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
interopTest("interop_objc_global_initializer") {
|
|
useGoldenData = true
|
|
source = "interop/objc_with_initializer/objc_test.kt"
|
|
interop = 'objcMisc'
|
|
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc_with_initializer/objc_misc.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcmisc.dylib"
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjcmisc.dylib")
|
|
}
|
|
}
|
|
}
|
|
|
|
interopTest("interop_objc_msg_send") {
|
|
source = "interop/objc/msg_send/main.kt"
|
|
interop = 'objcMessaging'
|
|
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/msg_send/messaging.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcmessaging.dylib"
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjcmessaging.dylib")
|
|
}
|
|
}
|
|
}
|
|
|
|
interopTest("interop_objc_direct") {
|
|
source = "interop/objc/direct/main.kt"
|
|
interop = "objcDirect"
|
|
}
|
|
|
|
interopTest("interop_objc_foreignException") {
|
|
source = "interop/objc/foreignException/objc_wrap.kt"
|
|
interop = 'foreignException'
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/foreignException/objc_wrap.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcexception.dylib"
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjcexception.dylib")
|
|
}
|
|
}
|
|
}
|
|
|
|
interopTest("interop_objc_foreignExceptionMode_wrap") {
|
|
source = "interop/objc/foreignException/objcExceptionMode_wrap.kt"
|
|
interop = 'foreignExceptionMode_wrap'
|
|
useGoldenData = true
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/foreignException/objc_wrap.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcexception.dylib"
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjcexception.dylib")
|
|
}
|
|
}
|
|
}
|
|
|
|
interopTest("interop_objc_foreignExceptionMode_default") {
|
|
source = "interop/objc/foreignException/objcExceptionMode_default.kt"
|
|
interop = 'foreignExceptionMode_default'
|
|
useGoldenData = true
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/foreignException/objc_wrap.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcexception.dylib"
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjcexception.dylib")
|
|
}
|
|
}
|
|
}
|
|
|
|
interopTest("interop_objc_kt34467") {
|
|
source = "interop/objc/kt34467/foo.kt"
|
|
interop = 'objcKt34467'
|
|
useGoldenData = true
|
|
}
|
|
|
|
interopTest("interop_objc_illegal_sharing_with_weak") {
|
|
source = "interop/objc/illegal_sharing_with_weak/main.kt"
|
|
interop = 'objc_illegal_sharing_with_weak'
|
|
|
|
if (isExperimentalMM) {
|
|
// Experimental MM supports arbitrary object sharing.
|
|
outputChecker = { it == "Before\nAfter true\n" }
|
|
} else {
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = {
|
|
it.startsWith("Before") && // Should crash after "Before"
|
|
!it.contains("After") && // But before "After"
|
|
it.contains("isObjectAliveShouldCrash") // And should contain stack trace.
|
|
}
|
|
}
|
|
}
|
|
|
|
interopTest("interop_objc_kt42172") {
|
|
enabled = !isNoopGC
|
|
source = "interop/objc/kt42172/main.kt"
|
|
interop = "objc_kt42172"
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
useGoldenData = true
|
|
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/kt42172/objclib.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjc_kt42172.dylib"
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjc_kt42172.dylib")
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
interopTest("interop_objc_kt48816_without_lazy_ir_for_caches") {
|
|
// Without a fix, fails in two-stage mode.
|
|
source = "interop/objc/kt48816/main.kt"
|
|
interop = "objc_kt48816"
|
|
// The bug was accidentally fixed with lazy IR for caches, so testing it with this feature disabled:
|
|
flags = ["-Xlazy-ir-for-caches=disable"]
|
|
}
|
|
|
|
interopTest("interop_objc_kt48816_with_lazy_ir_for_caches") {
|
|
source = "interop/objc/kt48816/main.kt"
|
|
interop = "objc_kt48816"
|
|
flags = ["-Xlazy-ir-for-caches=enable"]
|
|
}
|
|
|
|
interopTest("interop_objc_kt50648") {
|
|
source = 'interop/objc/kt50648/main.kt'
|
|
interop = "objc_kt50648"
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = {
|
|
it.contains("Converting Obj-C blocks with non-reference-typed return value to kotlin.Any is not supported (v)") &&
|
|
(it.contains("kfun:#main(){}") || project.globalTestArgs.contains('-opt')) // Stacktrace.
|
|
}
|
|
}
|
|
|
|
interopTest("interop_objc_kt53151") {
|
|
source = "interop/objc/kt53151/main.kt"
|
|
interop = "objc_kt53151"
|
|
}
|
|
|
|
interopTest("interop_objc_kt55938") {
|
|
source = "interop/objc/kt55938/main.kt"
|
|
lib = "interop/objc/kt55938/lib.kt"
|
|
interop = "objc_kt55938"
|
|
useGoldenData = true
|
|
enabled = cacheTesting != null
|
|
flags = [
|
|
"-Xauto-cache-from=$testOutputRoot/local/objc_kt55938",
|
|
"-Xauto-cache-from=$testOutputRoot/local/interop_objc_kt55938",
|
|
"-Xauto-cache-dir=$testOutputRoot/local/interop_objc_kt55938/cache",
|
|
"-Xsuppress-version-warnings", // suppresses warning about experimental language version, otherwise test fails with K2 due to -Werror
|
|
"-Werror" // to forbid retry with auto-cache disabled
|
|
]
|
|
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
def cacheDir = new File("-Xauto-cache-dir=$testOutputRoot/local/interop_objc_kt55938/cache")
|
|
cacheDir.deleteDir()
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/kt55938/objclib.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjc_kt55938.dylib"
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjc_kt55938.dylib")
|
|
}
|
|
}
|
|
}
|
|
|
|
standaloneTest("objc_arc_contract") {
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
ExecLlvmKt.execLlvmUtility(project, "llvm-as") {
|
|
args "$projectDir/interop/objc_arc_contract/main.ll"
|
|
args "-o", "$buildDir/objc_arc_contract.bc"
|
|
}
|
|
}
|
|
source = "interop/objc_arc_contract/main.kt"
|
|
useGoldenData = true
|
|
flags = ["-native-library", "$buildDir/objc_arc_contract.bc"]
|
|
}
|
|
|
|
interopTest("interop_objc_include_categories") {
|
|
useGoldenData = true
|
|
source = "interop/objc/include_categories/main.kt"
|
|
interop = "objc_include_categories"
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/include_categories/objc_include_categories.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjcincludecategories.dylib"
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjcincludecategories.dylib")
|
|
}
|
|
}
|
|
}
|
|
|
|
standaloneTest("interop_kt55653") {
|
|
// Test depends on macOS-specific AppKit
|
|
enabled = (project.testTarget == 'macos_x64' || project.testTarget == 'macos_arm64' || project.testTarget == null)
|
|
source = "interop/objc/kt55653/main.kt"
|
|
useGoldenData = true
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
standaloneTest("interop_kt40426") {
|
|
// Test depends on iOS-specific UIKit
|
|
enabled = (project.testTarget == 'ios_x64' || project.testTarget == 'ios_simulator_arm64' || project.testTarget == 'ios_arm64')
|
|
source = "interop/objc/kt40426/main.kt"
|
|
useGoldenData = true
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
interopTest("interop_objc_kt56402") {
|
|
// Test depends on macOS-specific AppKit
|
|
enabled = (project.testTarget == 'macos_x64' || project.testTarget == 'macos_arm64' || project.testTarget == null)
|
|
&& isExperimentalMM
|
|
&& !isNoopGC // requires some GC
|
|
source = 'interop/objc/kt56402/main.kt'
|
|
interop = "objc_kt56402"
|
|
flags = ["-tr", "-e", "runAllTests"] // Generate test suites, but use custom entrypoint.
|
|
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
project.extensions.execClang.execClangForCompilerTests(project.target) {
|
|
args "$projectDir/interop/objc/kt56402/objclib.m"
|
|
args "-lobjc", '-fobjc-arc'
|
|
args '-fPIC', '-shared', '-o', "$buildDir/libobjc_kt56402.dylib"
|
|
args '-framework', 'AppKit'
|
|
}
|
|
if (UtilsKt.isSimulatorTarget(project, project.target)) {
|
|
UtilsKt.codesign(project, "$buildDir/libobjc_kt56402.dylib")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.register("KT-50983", KonanDriverTest) {
|
|
// The test is not working on Windows Server 2019-based TeamCity agents for the unknown reason.
|
|
// TODO: Re-enable it after LLVM update where llvm-windres will be added.
|
|
enabled = false
|
|
doBeforeBuild {
|
|
mkdir(buildDir)
|
|
exec {
|
|
commandLine UtilsKt.binaryFromToolchain(project, "windres")
|
|
args "$projectDir/windows/KT-50983/File.rc", "-O", "coff", "-o", "$buildDir/File.res"
|
|
}
|
|
}
|
|
source = "windows/KT-50983/main.kt"
|
|
flags = ['-linker-option', "$buildDir/File.res"]
|
|
}
|
|
|
|
standaloneTest("jsinterop_math") {
|
|
doBeforeBuild {
|
|
def jsinteropScript = isWindows() ? "jsinterop.bat" : "jsinterop"
|
|
def jsinterop = "$kotlinNativeDist/bin/$jsinteropScript"
|
|
// TODO: We probably need a NativeInteropPlugin for jsinterop?
|
|
exec {
|
|
commandLine jsinterop, "-pkg", "kotlinx.interop.wasm.math", "-o", "$buildDir/jsmath", "-target", "wasm32"
|
|
}
|
|
|
|
}
|
|
dependsOn ':kotlin-native:wasm32PlatformLibs'
|
|
enabled = (project.testTarget == 'wasm32')
|
|
useGoldenData = true
|
|
source = "jsinterop/math.kt"
|
|
flags = ["-r", "$buildDir", "-l", "jsmath"]
|
|
}
|
|
|
|
standaloneTest("interop_libiconv") {
|
|
enabled = (project.testTarget == null)
|
|
source = "interop/libiconv.kt"
|
|
useGoldenData = true
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
standaloneTest("interop_zlib") {
|
|
enabled = (project.testTarget == null)
|
|
source = "interop/platform_zlib.kt"
|
|
useGoldenData = true
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
}
|
|
|
|
standaloneTest("interop_objc_illegal_sharing") {
|
|
disabled = !isAppleTarget(project)
|
|
source = "interop/objc/illegal_sharing.kt"
|
|
UtilsKt.dependsOnPlatformLibs(it)
|
|
if (isExperimentalMM) {
|
|
outputChecker = {
|
|
it.startsWith("Before") && it.contains("After")
|
|
}
|
|
} else {
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = {
|
|
it.startsWith("Before") && !it.contains("After")
|
|
}
|
|
}
|
|
}
|
|
|
|
dynamicTest("produce_dynamic") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
source = "produce_dynamic/simple/hello.kt"
|
|
cSource = "$projectDir/produce_dynamic/simple/main.c"
|
|
useGoldenData = true
|
|
}
|
|
|
|
dynamicTest("kt36639") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
source = "produce_dynamic/kt-36639/main.kt"
|
|
cSource = "$projectDir/produce_dynamic/kt-36639/main.c"
|
|
useGoldenData = true
|
|
}
|
|
|
|
dynamicTest("kt36878") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
source = "produce_dynamic/kt-36878/hello.kt"
|
|
cSource = "$projectDir/produce_dynamic/kt-36878/main.c"
|
|
useGoldenData = true
|
|
}
|
|
|
|
dynamicTest("kt39015") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
source = "produce_dynamic/kt-39015/hello.kt"
|
|
cSource = "$projectDir/produce_dynamic/kt-39015/main.c"
|
|
useGoldenData = true
|
|
}
|
|
|
|
dynamicTest("kt39496") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
source = "produce_dynamic/kt-39496/hello.kt"
|
|
cSource = "$projectDir/produce_dynamic/kt-39496/main.c"
|
|
useGoldenData = true
|
|
}
|
|
|
|
dynamicTest("kt41904") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
source = "produce_dynamic/kt-41904/hello.kt"
|
|
cSource = "$projectDir/produce_dynamic/kt-41904/main.c"
|
|
useGoldenData = true
|
|
}
|
|
|
|
for (i in 0..2) {
|
|
dynamicTest("kt42796_$i") {
|
|
clangTool = "clang++"
|
|
disabled = (project.testTarget == 'wasm32') || // wasm doesn't support -produce dynamic
|
|
(i==1 && isK2(project)) // KT-56182
|
|
source = "produce_dynamic/kt-42796/main-${i}.kt"
|
|
cSource = "$projectDir/produce_dynamic/kt-42796/main.cpp"
|
|
useGoldenData = true
|
|
clangFlags = ["-DTEST=$i", "-Werror"]
|
|
}
|
|
}
|
|
|
|
dynamicTest("kt42830") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
source = "produce_dynamic/kt-42830/box_unbox.kt"
|
|
cSource = "$projectDir/produce_dynamic/kt-42830/main.c"
|
|
useGoldenData = true
|
|
}
|
|
|
|
dynamicTest("produce_dynamic_unhandledException") {
|
|
disabled = (project.testTarget == 'wasm32') || // Uses exceptions + dynamic is unsupported for wasm.
|
|
(cacheTesting != null) // Disabled due to KT-47828.
|
|
source = "produce_dynamic/unhandledException/unhandled.kt"
|
|
cSource = "$projectDir/produce_dynamic/unhandledException/main.cpp"
|
|
clangTool = "clang++"
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { str -> str.startsWith("Kotlin hook: Exception. Runnable state: true") }
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
dynamicTest("interop_concurrentRuntime") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
disabled = true // KT-43180
|
|
source = "interop/concurrentTerminate/reverseInterop.kt"
|
|
cSource = "$projectDir/interop/concurrentTerminate/main.cpp"
|
|
clangTool = "clang++"
|
|
outputChecker = { str -> str.startsWith("Uncaught Kotlin exception: kotlin.RuntimeException: Example") }
|
|
expectedExitStatus = 99
|
|
}
|
|
|
|
dynamicTest("interop_kt42397") {
|
|
disabled = (project.testTarget == 'wasm32') || // wasm doesn't support -produce dynamic
|
|
isK2(project) // KT-56182
|
|
source = "interop/kt42397/knlibrary.kt"
|
|
cSource = "$projectDir/interop/kt42397/test.cpp"
|
|
clangTool = "clang++"
|
|
}
|
|
|
|
dynamicTest("interop_cleaners_main_thread") {
|
|
disabled = (project.testTarget == 'wasm32') || isNoopGC // wasm doesn't support -produce dynamic
|
|
source = "interop/cleaners/cleaners.kt"
|
|
cSource = "$projectDir/interop/cleaners/main_thread.cpp"
|
|
clangTool = "clang++"
|
|
useGoldenData = true
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
dynamicTest("interop_cleaners_second_thread") {
|
|
disabled = (project.testTarget == 'wasm32') || isNoopGC // wasm doesn't support -produce dynamic
|
|
source = "interop/cleaners/cleaners.kt"
|
|
cSource = "$projectDir/interop/cleaners/second_thread.cpp"
|
|
clangTool = "clang++"
|
|
useGoldenData = true
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
dynamicTest("interop_cleaners_leak") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
source = "interop/cleaners/cleaners.kt"
|
|
cSource = "$projectDir/interop/cleaners/leak.cpp"
|
|
clangTool = "clang++"
|
|
useGoldenData = true
|
|
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
|
|
dynamicTest("interop_migrating_main_thread_legacy") {
|
|
disabled = (project.testTarget == 'wasm32') || // wasm doesn't support -produce dynamic
|
|
isExperimentalMM // Experimental MM will not support legacy destroy runtime mode.
|
|
source = "interop/migrating_main_thread/lib.kt"
|
|
flags = ['-Xdestroy-runtime-mode=legacy']
|
|
clangFlags = ['-DIS_LEGACY']
|
|
cSource = "$projectDir/interop/migrating_main_thread/main.cpp"
|
|
clangTool = "clang++"
|
|
}
|
|
|
|
dynamicTest("interop_migrating_main_thread") {
|
|
disabled = (project.testTarget == 'wasm32') // wasm doesn't support -produce dynamic
|
|
source = "interop/migrating_main_thread/lib.kt"
|
|
flags = ['-Xdestroy-runtime-mode=on-shutdown']
|
|
if (isExperimentalMM) {
|
|
clangFlags = ['-DEXPERIMENTAL_MM']
|
|
}
|
|
cSource = "$projectDir/interop/migrating_main_thread/main.cpp"
|
|
clangTool = "clang++"
|
|
}
|
|
|
|
dynamicTest("interop_memory_leaks") {
|
|
disabled = (project.testTarget == 'wasm32') || // wasm doesn't support -produce dynamic
|
|
isExperimentalMM // Experimental MM will not support legacy destroy runtime mode.
|
|
source = "interop/memory_leaks/lib.kt"
|
|
cSource = "$projectDir/interop/memory_leaks/main.cpp"
|
|
clangTool = "clang++"
|
|
flags = ['-Xdestroy-runtime-mode=legacy'] // Runtime cannot be destroyed with interop with on-shutdown.
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> s.contains("Memory leaks detected, 1 objects leaked!") }
|
|
}
|
|
|
|
dynamicTest("interop_exceptions_throwThroughBridge") {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions + dynamic is unsupported for wasm.
|
|
source = "interop/exceptions/throwThroughBridge.kt"
|
|
cSource = "$projectDir/interop/exceptions/throwThroughBridge.cpp"
|
|
clangTool = "clang++"
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> !s.contains("Should not happen") }
|
|
interop = "exceptions_throwThroughBridge"
|
|
}
|
|
|
|
dynamicTest("interop_kotlin_exception_hook") {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions + dynamic is unsupported for wasm.
|
|
source = "interop/exceptions/exceptionHook.kt"
|
|
cSource = "$projectDir/interop/exceptions/exceptionHook.cpp"
|
|
clangTool = "clang++"
|
|
expectedExitStatusChecker = { it != 0 }
|
|
outputChecker = { s -> s.contains("OK. Kotlin unhandled exception hook") }
|
|
}
|
|
|
|
interopTest("interop_exceptions_cCallback") {
|
|
disabled = (project.testTarget == 'wasm32') // Uses exceptions
|
|
source = "interop/exceptions/cCallback.kt"
|
|
outputChecker = { s -> s.contains("CATCH IN C++") }
|
|
interop = "exceptions_cCallback"
|
|
}
|
|
|
|
tasks.register("library_ir_provider_mismatch", KonanDriverTest) {
|
|
disabled = isAggressiveGC || // No need to test with different GC schedulers
|
|
isK2(project) // KT-56855
|
|
|
|
def dir = buildDir.absolutePath
|
|
def lib = "$projectDir/link/ir_providers/library/empty.kt"
|
|
def invalidManifest = "$projectDir/link/ir_providers/library/manifest.properties"
|
|
|
|
def currentTarget = project.target.name
|
|
|
|
doBeforeBuild {
|
|
konanc("$lib -p library -o $dir/supported_ir_provider/empty -target $currentTarget")
|
|
konanc("$lib -p library -o $dir/unsupported_ir_provider/empty -manifest $invalidManifest -target $currentTarget")
|
|
|
|
}
|
|
source = "link/ir_providers/hello.kt"
|
|
flags = ['-target', currentTarget, '-l', 'empty', '-r', "$dir/unsupported_ir_provider", '-r', "$dir/supported_ir_provider"]
|
|
compilerMessages = true
|
|
def messages = "warning: skipping $dir/unsupported_ir_provider/empty.klib. The library requires unknown IR provider UNSUPPORTED.\nhello\n"
|
|
messages = PlatformInfo.isWindows() ? messages.replaceAll('\\/', '\\\\') : messages
|
|
outputChecker = { out ->
|
|
messages.split("\n")
|
|
.collect { line -> out.contains(line) }
|
|
.every { it == true }
|
|
}
|
|
}
|
|
|
|
standaloneTest("kt51302") {
|
|
enabled = project.target.name == project.hostName
|
|
source = "serialization/KT-51302/main.kt"
|
|
flags = ["-l", "$projectDir/serialization/KT-51302/kt51302_dependency"]
|
|
}
|
|
|
|
standaloneTest("fake_override_0") {
|
|
def sources = "$projectDir/link/fake_overrides"
|
|
def dir = buildDir.absolutePath
|
|
doBeforeBuild {
|
|
konanc("$sources/base.kt -p library -target ${target.name} -o $dir/base")
|
|
konanc("$sources/move.kt -p library -target ${target.name} -o $dir/move -r $dir -l base")
|
|
konanc("$sources/use.kt -p library -target ${target.name} -o $dir/use -r $dir -l move")
|
|
konanc("$sources/move2.kt -p library -target ${target.name} -o $dir/move -r $dir -l base")
|
|
}
|
|
source = "$sources/main.kt"
|
|
flags = ["-l", "use", "-r", "$dir"]
|
|
useGoldenData = true
|
|
}
|
|
|
|
standaloneTest("split_compilation_pipeline") {
|
|
// Test infrastructure does not support passing flags only to the second stage,
|
|
// and we can't pass -Xcompile-from-bitcode when producing library. Thus, this test
|
|
// does not support 2-stage compilation for now.
|
|
// Also, it is failing for some reason on Windows CI, but since MinGW targets are not inteneded
|
|
// to use this mode, we can disable it for these targets.
|
|
enabled = !twoStageEnabled && project.target.name != "mingw_x64" && project.target.name != "mingw_x86"
|
|
def dir = buildDir.absolutePath
|
|
source = "link/private_fake_overrides/override_main.kt"
|
|
doBeforeBuild {
|
|
konanc("$projectDir/link/private_fake_overrides/override_lib.kt -p library -target ${target.name} -o $dir/lib")
|
|
konanc("$projectDir/$source -target ${target.name} -o $dir/out -r $dir -l lib " +
|
|
"-Xtemporary-files-dir=$dir/tmp/split " +
|
|
"-Xwrite-dependencies-to=${dir}/split_compilation_pipeline.deps")
|
|
}
|
|
flags = ["-Xread-dependencies-from=${dir}/split_compilation_pipeline.deps", "-Xcompile-from-bitcode=${dir}/tmp/split/out.bc"]
|
|
useGoldenData = true
|
|
}
|
|
|
|
linkTest("private_fake_overrides_0") {
|
|
source = "link/private_fake_overrides/inherit_main.kt"
|
|
lib = "link/private_fake_overrides/inherit_lib.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
linkTest("private_fake_overrides_1") {
|
|
source = "link/private_fake_overrides/override_main.kt"
|
|
lib = "link/private_fake_overrides/override_lib.kt"
|
|
useGoldenData = true
|
|
}
|
|
|
|
linkTest("remap_expect_property_refs") {
|
|
disabled = isK2(project) // KT-56071
|
|
source = "codegen/mpp/remap_expect_property_ref_main.kt"
|
|
lib = "codegen/mpp/remap_expect_property_ref_lib.kt"
|
|
flags = ["-Xmulti-platform"]
|
|
useGoldenData = true
|
|
}
|
|
|
|
Task frameworkTest(String name, Closure<FrameworkTest> configurator) {
|
|
return KotlinNativeTestKt.createTest(project, name, FrameworkTest) { task ->
|
|
configurator.delegate = task
|
|
UtilsKt.dependsOnDist(task)
|
|
configurator()
|
|
if (task.enabled) {
|
|
konanArtifacts {
|
|
task.frameworks.forEach { fr ->
|
|
framework(fr.name, targets: [target.name]) {
|
|
fr.sources.forEach { src ->
|
|
srcFiles src
|
|
}
|
|
baseDir "$testOutputFramework/${task.name}"
|
|
|
|
fr.libraries.forEach { library ->
|
|
dependsOn konanArtifacts[library].getByTarget(target.name)
|
|
libraries {
|
|
file konanArtifacts[library].getArtifactByTarget(target.name)
|
|
}
|
|
linkerOpts "-L$buildDir"
|
|
UtilsKt.dependsOnKonanBuildingTask(task, library, target)
|
|
}
|
|
|
|
extraOpts fr.bitcode ? "-Xembed-bitcode" : "-Xembed-bitcode-marker"
|
|
if (fr.isStatic) extraOpts "-Xstatic-framework"
|
|
extraOpts fr.opts
|
|
extraOpts project.globalTestArgs
|
|
|
|
artifactName fr.artifact
|
|
}
|
|
UtilsKt.dependsOnDist(project.tasks.findByName("compileKonan${fr.name.capitalize()}${UtilsKt.getTestTargetSuffix(project)}"))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Task objcExportTest(
|
|
Task allTask,
|
|
String suffix,
|
|
List<String> frameworkOpts,
|
|
List<String> swiftOpts,
|
|
Boolean isStaticFramework,
|
|
Boolean needLazyHeaderCheck
|
|
) {
|
|
needLazyHeaderCheck = needLazyHeaderCheck && !isK2(project) // generating lazy headers is NYI in K2
|
|
final String name = "testObjCExport$suffix"
|
|
final String frameworkName = "Kt$suffix"
|
|
final String expectedLazyHeaderName = "expectedLazy${suffix}.h"
|
|
final Task task = frameworkTest(name) {
|
|
final String dir = "$testOutputFramework/$name"
|
|
final File lazyHeader = file("$dir/$target-lazy.h")
|
|
lazyHeader.delete() // Clean up after previous runs
|
|
|
|
doLast {
|
|
// Check lazy header.
|
|
if (needLazyHeaderCheck) {
|
|
final String expectedLazyHeaderDir = file("objcexport/")
|
|
final File expectedLazyHeader = new File(expectedLazyHeaderDir, expectedLazyHeaderName)
|
|
|
|
if (!expectedLazyHeader.exists() || expectedLazyHeader.readLines() != lazyHeader.readLines()) {
|
|
exec {
|
|
commandLine 'diff', '-u', expectedLazyHeader, lazyHeader
|
|
ignoreExitValue = true
|
|
}
|
|
|
|
copy {
|
|
from(lazyHeader)
|
|
into(expectedLazyHeaderDir)
|
|
rename { expectedLazyHeaderName }
|
|
}
|
|
|
|
throw new Error("$expectedLazyHeader file patched;\nRun gradlew ${allTask.path} --continue and don't forget to commit the patch")
|
|
}
|
|
}
|
|
|
|
// Check bundle ID.
|
|
final String frameworkPath = "$dir/$target/Kt.framework"
|
|
final Pattern pattern = ~"<key>CFBundleIdentifier</key>\n\\s*<string>foo.bar</string>"
|
|
final String plistPath = (target.family == Family.OSX) ?
|
|
"$frameworkPath/Resources/Info.plist" :
|
|
"$frameworkPath/Info.plist"
|
|
final String plistContent = file(plistPath).text
|
|
if (!pattern.matcher(plistContent).find()) {
|
|
throw new Error("Unexpected Info.plist content:\n$plistContent")
|
|
}
|
|
}
|
|
|
|
def libraryName = frameworkName + "Library"
|
|
def noEnumEntriesLibraryName = frameworkName + "NoEnumEntriesLibrary"
|
|
konanArtifacts {
|
|
library(libraryName, targets: [target.name]) {
|
|
srcDir "objcexport/library"
|
|
artifactName "test-$libraryName"
|
|
delegate.getByTarget(target.name).configure{
|
|
UtilsKt.dependsOnDist(it)
|
|
}
|
|
|
|
extraOpts "-Xshort-module-name=MyLibrary"
|
|
extraOpts "-module-name", "org.jetbrains.kotlin.native.test-library"
|
|
}
|
|
library(noEnumEntriesLibraryName, targets: [target.name]) {
|
|
srcDir "objcexport/noEnumEntries"
|
|
artifactName "test-no-enum-entries-$libraryName"
|
|
delegate.getByTarget(target.name).configure{
|
|
UtilsKt.dependsOnDist(it)
|
|
}
|
|
|
|
extraOpts "-Xshort-module-name=NoEnumEntriesLibrary"
|
|
extraOpts "-module-name", "org.jetbrains.kotlin.native.test-no-enum-entries-library"
|
|
extraOpts "-XXLanguage:-EnumEntries"
|
|
}
|
|
}
|
|
codesign = !isStaticFramework
|
|
framework(frameworkName) {
|
|
sources = ['objcexport']
|
|
libraries = [libraryName, noEnumEntriesLibraryName]
|
|
artifact = 'Kt'
|
|
bitcode = !isStaticFramework
|
|
isStatic = isStaticFramework
|
|
if (needLazyHeaderCheck) {
|
|
opts += "-Xemit-lazy-objc-header=$lazyHeader"
|
|
}
|
|
opts += [
|
|
"-Xexport-kdoc",
|
|
"-Xbinary=bundleId=foo.bar",
|
|
"-Xexport-library=test-no-enum-entries-${libraryName}.klib"
|
|
]
|
|
opts += frameworkOpts
|
|
}
|
|
swiftSources = ['objcexport']
|
|
swiftExtraOpts = swiftOpts
|
|
if (isNoopGC) {
|
|
swiftExtraOpts += ["-D", "NOOP_GC"]
|
|
}
|
|
if (isAggressiveGC) {
|
|
swiftExtraOpts += ["-D", "AGGRESSIVE_GC"]
|
|
}
|
|
}
|
|
allTask.dependsOn(task)
|
|
return task
|
|
}
|
|
|
|
|
|
|
|
if (isAppleTarget(project)) {
|
|
final Task ObjCExportAllTask = tasks.create("testObjCExportAll")
|
|
objcExportTest(
|
|
ObjCExportAllTask,
|
|
'',
|
|
[],
|
|
[],
|
|
false,
|
|
true
|
|
)
|
|
objcExportTest(
|
|
ObjCExportAllTask,
|
|
'NoGenerics',
|
|
["-Xno-objc-generics"],
|
|
[ '-D', 'NO_GENERICS' ],
|
|
false,
|
|
true
|
|
)
|
|
objcExportTest(
|
|
ObjCExportAllTask,
|
|
'LegacySuspendUnit',
|
|
["-Xbinary=unitSuspendFunctionObjCExport=legacy"],
|
|
[ '-D', 'LEGACY_SUSPEND_UNIT_FUNCTION_EXPORT' ],
|
|
false,
|
|
true
|
|
)
|
|
objcExportTest(
|
|
ObjCExportAllTask,
|
|
'NoSwiftMemberNameMangling',
|
|
["-Xbinary=objcExportDisableSwiftMemberNameMangling=true"],
|
|
[ '-D', 'DISABLE_MEMBER_NAME_MANGLING' ],
|
|
false,
|
|
false
|
|
)
|
|
objcExportTest(
|
|
ObjCExportAllTask,
|
|
'NoInterfaceMemberNameMangling',
|
|
["-Xbinary=objcExportIgnoreInterfaceMethodCollisions=true"],
|
|
[ '-D', 'DISABLE_INTERFACE_METHOD_NAME_MANGLING' ],
|
|
false,
|
|
false
|
|
)
|
|
|
|
objcExportTest(
|
|
ObjCExportAllTask,
|
|
'Static',
|
|
["-Xbinary=objcExportSuspendFunctionLaunchThreadRestriction=none"],
|
|
[ '-D', 'ALLOW_SUSPEND_ANY_THREAD' ],
|
|
true,
|
|
false
|
|
)
|
|
|
|
|
|
frameworkTest('testValuesGenericsFramework') {
|
|
framework('ValuesGenerics') {
|
|
sources = ['objcexport/values.kt', 'framework/values_generics']
|
|
}
|
|
swiftSources = ['framework/values_generics/']
|
|
}
|
|
|
|
if(!isK2(project)) // KT-56271
|
|
frameworkTest("testStdlibFramework") {
|
|
framework('Stdlib') {
|
|
sources = ['framework/stdlib']
|
|
bitcode = true
|
|
}
|
|
if (cacheTesting == null) fullBitcode = true
|
|
swiftSources = ['framework/stdlib/']
|
|
}
|
|
|
|
if (cacheTesting != null && cacheTesting.isDynamic) {
|
|
// testMultipleFrameworks disabled until https://youtrack.jetbrains.com/issue/KT-34262 is fixed.
|
|
} else frameworkTest("testMultipleFrameworks") {
|
|
framework('First') {
|
|
sources = ['framework/multiple/framework1', 'framework/multiple/shared']
|
|
bitcode = true
|
|
}
|
|
framework('Second') {
|
|
sources = ['framework/multiple/framework2', 'framework/multiple/shared']
|
|
bitcode = true
|
|
}
|
|
swiftSources = ['framework/multiple']
|
|
}
|
|
|
|
frameworkTest("testMultipleFrameworksStatic") {
|
|
// this test doesn't work with caches. For now caches are enabled only if isExperimentalMM is true, even if cacheTesting is passed
|
|
if (cacheTesting != null && isExperimentalMM && !runtimeAssertionsPanic) {
|
|
// See https://youtrack.jetbrains.com/issue/KT-34261.
|
|
expectedExitStatus = 134
|
|
}
|
|
|
|
framework('FirstStatic') {
|
|
artifact = 'First'
|
|
sources = ['framework/multiple/framework1', 'framework/multiple/shared']
|
|
bitcode = true
|
|
isStatic = true
|
|
opts = ['-Xstatic-framework', "-Xpre-link-caches=enable"]
|
|
}
|
|
framework('SecondStatic') {
|
|
artifact = 'Second'
|
|
sources = ['framework/multiple/framework2', 'framework/multiple/shared']
|
|
bitcode = true
|
|
isStatic = true
|
|
opts = ['-Xstatic-framework', "-Xpre-link-caches=enable"]
|
|
}
|
|
codesign = false
|
|
swiftSources = ['framework/multiple']
|
|
}
|
|
|
|
frameworkTest("testGh3343Framework") {
|
|
framework('Gh3343') {
|
|
sources = ['framework/gh3343']
|
|
libraries = ['objcGh3343']
|
|
}
|
|
swiftSources = ['framework/gh3343/']
|
|
}
|
|
|
|
frameworkTest("testKt42397Framework") {
|
|
enabled = !project.globalTestArgs.contains('-opt')
|
|
framework("Kt42397") {
|
|
sources = ['framework/kt42397']
|
|
}
|
|
swiftSources = ['framework/kt42397']
|
|
}
|
|
|
|
frameworkTest("testKt43517Framework") {
|
|
framework('Kt43517') {
|
|
sources = ['framework/kt43517']
|
|
libraries = ['objcKt43517']
|
|
}
|
|
swiftSources = ['framework/kt43517/']
|
|
}
|
|
|
|
frameworkTest("testStackTraceFramework") {
|
|
enabled = !project.globalTestArgs.contains('-opt')
|
|
framework('Stacktrace') {
|
|
sources = ['framework/stacktrace']
|
|
opts = ['-g']
|
|
}
|
|
swiftSources = ['framework/stacktrace/']
|
|
}
|
|
|
|
frameworkTest("testStackTraceBridgesFramework") {
|
|
enabled = !project.globalTestArgs.contains('-opt')
|
|
framework('StacktraceBridges') {
|
|
sources = ['framework/stacktraceBridges']
|
|
opts = ['-g']
|
|
}
|
|
swiftSources = ['framework/stacktraceBridges/']
|
|
}
|
|
|
|
|
|
frameworkTest("testStackTraceByLibbacktraceFramework") {
|
|
enabled = !project.globalTestArgs.contains('-opt')
|
|
framework('StacktraceByLibbacktrace') {
|
|
sources = ['framework/stacktraceByLibbacktrace']
|
|
opts = ['-g', '-Xbinary=sourceInfoType=libbacktrace']
|
|
}
|
|
swiftSources = ['framework/stacktraceByLibbacktrace/']
|
|
}
|
|
|
|
frameworkTest("testAbstractInstantiationFramework") {
|
|
framework('AbstractInstantiation') {
|
|
sources = ['framework/abstractInstantiation']
|
|
}
|
|
swiftSources = ['framework/abstractInstantiation/']
|
|
expectedExitStatus = 134
|
|
}
|
|
|
|
frameworkTest("testFrameworkBundleId") {
|
|
def currentTarget = project.target.name
|
|
enabled = currentTarget.startsWith("mac")
|
|
|
|
framework("Foo") {
|
|
sources = ["framework/bundle_id/main.kt", "framework/bundle_id/lib.kt"]
|
|
opts = ["-Xbinary=bundleVersion=FooBundleVersion", "-Xbinary=bundleShortVersionString=FooBundleShortVersionString"]
|
|
}
|
|
swiftSources = []
|
|
|
|
doLast {
|
|
def frameworkPath = "$testOutputFramework/testFrameworkBundleId/$target/Foo.framework"
|
|
def bundleIdPattern = ~"<key>CFBundleIdentifier</key>\n\\s*<string>Foo</string>"
|
|
def bundleShortVersionStringPattern = ~"<key>CFBundleShortVersionString</key>\n\\s*<string>FooBundleShortVersionString</string>"
|
|
def bundleVersionPattern = ~"<key>CFBundleVersion</key>\n\\s*<string>FooBundleVersion</string>"
|
|
def plistContent = file("$frameworkPath/Resources/Info.plist").text
|
|
if (!bundleIdPattern.matcher(plistContent).find()) {
|
|
throw new Error("Unexpected CFBundleIdentifier in Info.plist:\n$plistContent")
|
|
}
|
|
if (!bundleShortVersionStringPattern.matcher(plistContent).find()) {
|
|
throw new Error("Unexpected CFBundleShortVersionString in Info.plist:\n$plistContent")
|
|
}
|
|
if (!bundleVersionPattern.matcher(plistContent).find()) {
|
|
throw new Error("Unexpected CFBundleVersion in Info.plist:\n$plistContent")
|
|
}
|
|
}
|
|
}
|
|
|
|
frameworkTest("testForwardDeclarationsFramework") {
|
|
framework('ForwardDeclarations') {
|
|
sources = ['framework/forwardDeclarations']
|
|
libraries = ['frameworkForwardDeclarations']
|
|
}
|
|
swiftSources = ['framework/forwardDeclarations/']
|
|
}
|
|
|
|
frameworkTest("testFrameworkUsesFoundationModule") {
|
|
framework("Bar") {
|
|
sources = ["framework/use_foundation_module/framework.kt"]
|
|
}
|
|
swiftSources = []
|
|
doLast {
|
|
def frameworkPath = "$testOutputFramework/testFrameworkUsesFoundationModule/$target/Bar.framework"
|
|
def moduleMapContent = file("$frameworkPath/Modules/module.modulemap").text
|
|
def useFoundationPattern = ~"use Foundation"
|
|
if (!useFoundationPattern.matcher(moduleMapContent).find()) {
|
|
throw new Error("Expected use of Foundation module:\n$moduleMapContent")
|
|
}
|
|
}
|
|
}
|
|
|
|
frameworkTest("testKt56233Framework") {
|
|
enabled = isExperimentalMM // Fails with legacy MM. It's deprecated, so won't fix.
|
|
framework("Kt56233") {
|
|
sources = ['framework/kt56233']
|
|
}
|
|
swiftSources = ['framework/kt56233']
|
|
}
|
|
|
|
frameworkTest("testPermanentObjectsFramework") {
|
|
enabled = isExperimentalMM && !isNoopGC // Requires gc to actually happen.
|
|
framework("PermanentObjects") {
|
|
sources = ['framework/permanentObjects']
|
|
opts = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
|
|
}
|
|
swiftSources = ['framework/permanentObjects']
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Creates tasks to build and execute Harmony regex tests with GTEST logger.
|
|
*/
|
|
KotlinNativeTestKt.createTest(project, 'harmonyRegexTest', KonanGTest) { task ->
|
|
task.enabled = (project.testTarget != 'wasm32') // Uses exceptions.
|
|
&& !isAggressiveGC // TODO: Investigate why too slow
|
|
task.useFilter = false
|
|
task.testLogger = KonanTest.Logger.GTEST
|
|
|
|
def sources = UtilsKt.getFilesToCompile(project, ["../../../libraries/stdlib/native-wasm/test/harmony_regex"], [])
|
|
|
|
konanArtifacts {
|
|
program('harmonyRegexTest', targets: [target.name]) {
|
|
srcFiles sources
|
|
baseDir "$testOutputStdlib/harmonyRegexTest"
|
|
extraOpts '-tr'
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
|
|
if (UtilsKt.getTestTargetSupportsCodeCoverage(project)) {
|
|
task coverage_basic_program(type: CoverageTest) {
|
|
|
|
binaryName = "CoverageBasic"
|
|
numberOfCoveredFunctions = 1
|
|
numberOfCoveredLines = 3
|
|
|
|
konanArtifacts {
|
|
program(binaryName, targets: [ target ]) {
|
|
srcDir 'coverage/basic/program'
|
|
baseDir "$testOutputCoverage/$binaryName"
|
|
entryPoint "coverage.basic.program.main"
|
|
extraOpts "-Xcoverage", "-Xcoverage-file=$profrawFile"
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
|
|
task coverage_basic_library(type: CoverageTest) {
|
|
|
|
binaryName = "CoverageBasicLibrary"
|
|
numberOfCoveredFunctions = 1
|
|
numberOfCoveredLines = 1
|
|
|
|
konanArtifacts {
|
|
library("lib_to_cover", targets: [target.name]) {
|
|
srcFiles 'coverage/basic/library/library.kt'
|
|
}
|
|
program(binaryName, targets: [ target ]) {
|
|
srcFiles 'coverage/basic/library/main.kt'
|
|
libraries {
|
|
artifact konanArtifacts.lib_to_cover
|
|
}
|
|
baseDir "$testOutputCoverage/$binaryName"
|
|
entryPoint "coverage.basic.library.main"
|
|
extraOpts "-Xcoverage-file=$profrawFile", "-Xlibrary-to-cover=${konanArtifacts.lib_to_cover.getArtifactByTarget(target.name)}"
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
|
|
task coverage_controlflow(type: CoverageTest) {
|
|
binaryName = "CoverageControlFlow"
|
|
numberOfCoveredFunctions = 1
|
|
numberOfCoveredLines = 102
|
|
|
|
konanArtifacts {
|
|
program(binaryName, targets: [ target ]) {
|
|
srcDir 'coverage/basic/controlflow'
|
|
baseDir "$testOutputCoverage/$binaryName"
|
|
entryPoint "coverage.basic.controlflow.main"
|
|
extraOpts "-Xcoverage", "-Xcoverage-file=$profrawFile"
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
|
|
task coverage_jumps(type: CoverageTest) {
|
|
binaryName = "CoverageJumps"
|
|
numberOfCoveredFunctions = 8
|
|
numberOfCoveredLines = 74
|
|
|
|
konanArtifacts {
|
|
program(binaryName, targets: [ target ]) {
|
|
srcDir 'coverage/basic/jumps'
|
|
baseDir "$testOutputCoverage/$binaryName"
|
|
entryPoint "coverage.basic.jumps.main"
|
|
extraOpts "-Xcoverage", "-Xcoverage-file=$profrawFile"
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
|
|
task coverage_smoke0(type: CoverageTest) {
|
|
binaryName = "CoverageSmoke0"
|
|
numberOfCoveredFunctions = 2
|
|
numberOfCoveredLines = 5
|
|
|
|
konanArtifacts {
|
|
program(binaryName, targets: [ target ]) {
|
|
srcDir 'coverage/basic/smoke0'
|
|
baseDir "$testOutputCoverage/$binaryName"
|
|
entryPoint "coverage.basic.smoke0.main"
|
|
extraOpts "-Xcoverage", "-Xcoverage-file=$profrawFile"
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
|
|
task coverage_smoke1(type: CoverageTest) {
|
|
binaryName = "CoverageSmoke1"
|
|
numberOfCoveredFunctions = 9
|
|
numberOfCoveredLines = 33
|
|
|
|
konanArtifacts {
|
|
program(binaryName, targets: [ target ]) {
|
|
srcDir 'coverage/basic/smoke1'
|
|
baseDir "$testOutputCoverage/$binaryName"
|
|
entryPoint "coverage.basic.smoke1.main"
|
|
extraOpts "-Xcoverage", "-Xcoverage-file=$profrawFile"
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
standaloneTest("local_ea_arraysfieldwrite") {
|
|
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
|
|
useGoldenData = true
|
|
flags = ["-opt"]
|
|
source = "codegen/localEscapeAnalysis/arraysFieldWrite.kt"
|
|
}
|
|
|
|
tasks.register("override_konan_properties0", KonanDriverTest) {
|
|
disabled = isAggressiveGC // No need to test with different GC schedulers
|
|
|| isK2(project) // KT-56855
|
|
def overrides = PlatformInfo.isWindows()
|
|
? '-Xoverride-konan-properties="llvmInlineThreshold=76"'
|
|
: '-Xoverride-konan-properties=llvmInlineThreshold=76'
|
|
flags = [
|
|
"-opt",
|
|
"-Xverbose-phases=MandatoryBitcodeLLVMPostprocessingPhase",
|
|
overrides
|
|
]
|
|
compilerMessages = true
|
|
source = "link/ir_providers/hello.kt"
|
|
def messages = "inline_threshold: 76\nhello\n"
|
|
outputChecker = { out ->
|
|
messages.split("\n")
|
|
.collect { line -> out.contains(line) }
|
|
.every { it == true }
|
|
}
|
|
}
|
|
|
|
tasks.register("llvm_variant_dev", KonanDriverTest) {
|
|
// We use clang from Xcode on macOS for apple targets,
|
|
// so it is hard to reliably detect LLVM variant for these targets.
|
|
disabled = isAppleTarget(project)
|
|
|| isAggressiveGC // No need to test with different GC schedulers
|
|
|| isK2(project) // KT-56855
|
|
flags = [
|
|
"-Xllvm-variant=dev",
|
|
"-Xverbose-phases=ObjectFiles"
|
|
]
|
|
compilerMessages = true
|
|
source = "link/ir_providers/hello.kt"
|
|
// User LLVM variant has "essentials" suffix.
|
|
def message = "-essentials"
|
|
outputChecker = { out -> !out.contains(message) }
|
|
}
|
|
|
|
/**
|
|
* Builds tests into a single binary with TestRunner
|
|
*/
|
|
task buildKonanTests { t ->
|
|
def compileList = [ "codegen", "datagen", "lower", "runtime", "serialization", "sanity" ]
|
|
|
|
// These tests should not be built into the TestRunner's test executable
|
|
def excludeList = [ "codegen/inline/returnLocalClassFromBlock.kt" ]
|
|
project.tasks
|
|
.withType(KonanStandaloneTest.class)
|
|
.each {
|
|
// add library and source files
|
|
if (it instanceof KonanLinkTest) {
|
|
excludeList += it.lib
|
|
}
|
|
if (it.source != null) {
|
|
excludeList += it.source
|
|
}
|
|
}
|
|
def sources = UtilsKt.getFilesToCompile(project, compileList, excludeList)
|
|
|
|
konanArtifacts {
|
|
program('localTest', targets: [target.name]) {
|
|
srcFiles sources
|
|
baseDir testOutputLocal
|
|
extraOpts '-ea' // Without this option assertions would remain inactive.
|
|
extraOpts '-tr'
|
|
extraOpts '-Xverify-ir=error'
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
|
|
// Set build dependencies.
|
|
dependsOn compileKonanLocalTest
|
|
def buildTask = UtilsKt.findKonanBuildTask(project, "localTest", target)
|
|
UtilsKt.dependsOnDist(buildTask)
|
|
|
|
// Local tests build into a single binary should depend on this task
|
|
project.tasks
|
|
.withType(KonanLocalTest.class)
|
|
.matching { !(it instanceof KonanStandaloneTest) }
|
|
.configureEach { it.dependsOn(t) }
|
|
}
|
|
|
|
|
|
sourceSets {
|
|
nopPlugin {
|
|
kotlin {
|
|
srcDir 'extensions/nop/src/main/kotlin'
|
|
}
|
|
}
|
|
}
|
|
|
|
compileNopPluginKotlin {
|
|
kotlinOptions.freeCompilerArgs += ['-Xskip-prerelease-check']
|
|
}
|
|
|
|
Task pluginTest(String name, String pluginName, Closure configureClosure) {
|
|
def jarTask = project.tasks.register("jar-$pluginName", Jar) {
|
|
it.dependsOn("compile${pluginName.capitalize()}Kotlin")
|
|
from {
|
|
sourceSets[pluginName].output
|
|
}
|
|
baseName = pluginName
|
|
destinationDirectory = buildDir
|
|
}
|
|
def taskName = "$name-with-$pluginName"
|
|
return KotlinNativeTestKt.createTest(project, taskName, KonanStandaloneTest) { task ->
|
|
task.configure(configureClosure)
|
|
task.dependsOn(jarTask)
|
|
if (task.enabled) {
|
|
konanArtifacts {
|
|
program(taskName, targets: [target.name]) {
|
|
baseDir "$testOutputLocal/$taskName"
|
|
srcFiles task.getSources()
|
|
extraOpts task.flags + "-Xplugin=$buildDir/nop-plugin.jar"
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
pluginTest("runtime_basic_init", "nopPlugin") {
|
|
disabled = (project.testTarget == 'wasm32')
|
|
source = "runtime/basic/runtime_basic_init.kt"
|
|
flags = ["-tr"]
|
|
}
|
|
|
|
|
|
Task fileCheckTest(String name, Closure<FileCheckTest> configureClosure) {
|
|
return project.tasks.create(name, FileCheckTest) { task ->
|
|
task.configure(configureClosure)
|
|
task.llvmIr = project.file("$testOutputFileCheck/$name/$target/out.${task.phaseToCheck}.ll")
|
|
|
|
KonanTarget target = task.target
|
|
boolean isCrossCompiling = target != project.target
|
|
|
|
// Bitcode that is generated in presence of caches or two-stage compilation differs from the "closed world"-generated,
|
|
// so disable these tests for now.
|
|
if (task.enabled && (twoStageEnabled || target.name == 'linux_mips32'))
|
|
task.enabled = false
|
|
|
|
if (task.enabled) {
|
|
konanArtifacts {
|
|
def lib = task.interop
|
|
if (lib != null) {
|
|
UtilsKt.dependsOnKonanBuildingTask(task, lib, target)
|
|
}
|
|
if (!task.generateFramework) {
|
|
// We could use `bitcode` here to make things faster. But:
|
|
// 1. `bitcode` has no other usages.
|
|
// 2. Unification should help porting to the new test infra.
|
|
// 3. Compiler might behave differently when outputting bitcode instead of object files.
|
|
program(name, targets: [target]) {
|
|
srcFiles task.annotatedSource
|
|
baseDir "$testOutputFileCheck/$name"
|
|
if (!isCrossCompiling) {
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
extraOpts task.extraOpts
|
|
extraOpts "-Xsave-llvm-ir-directory=$testOutputFileCheck/$name/$target"
|
|
extraOpts "-Xsave-llvm-ir-after=${task.phaseToCheck}"
|
|
if (lib != null) {
|
|
libraries {
|
|
artifact lib
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
// Framework support is much weakier than `frameworkTest`, but we don't need much.
|
|
framework(name, targets: [target]) {
|
|
srcFiles task.annotatedSource
|
|
baseDir "$testOutputFileCheck/$name"
|
|
if (!isCrossCompiling) {
|
|
extraOpts project.globalTestArgs
|
|
}
|
|
extraOpts "-Xsave-llvm-ir-directory=$testOutputFileCheck/$name/$target"
|
|
extraOpts "-Xsave-llvm-ir-after=${task.phaseToCheck}"
|
|
|
|
if (lib != null) {
|
|
libraries {
|
|
artifact lib
|
|
}
|
|
}
|
|
}
|
|
}
|
|
UtilsKt.dependsOnKonanBuildingTask(task, name, target)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fileCheckTest("filecheck_smoke0") {
|
|
annotatedSource = project.file('filecheck/smoke0.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_when") {
|
|
annotatedSource = project.file('filecheck/when.kt')
|
|
}
|
|
|
|
if (HostManager.@Companion.hostIsMac) {
|
|
fileCheckTest("filecheck_force_arm_instruction_set") {
|
|
enabled = enabled && cacheTesting == null
|
|
annotatedSource = project.file('filecheck/force_arm_instruction_set.kt')
|
|
targetName = "watchos_arm32"
|
|
// Perform check after optimization pipeline because
|
|
// LLVM might infer attributes.
|
|
phaseToCheck = "LTOBitcodeOptimization"
|
|
}
|
|
|
|
fileCheckTest("filecheck_redundant_safepoints_removal_smallbinary") {
|
|
enabled = isExperimentalMM && project.globalTestArgs.contains("-opt")
|
|
annotatedSource = project.file('filecheck/redundant_safepoints.kt')
|
|
targetName = "watchos_arm32"
|
|
checkPrefix = "CHECK-SMALLBINARY"
|
|
extraOpts = ["-Xbinary=memoryModel=experimental", "-opt"]
|
|
phaseToCheck = "RemoveRedundantSafepoints"
|
|
}
|
|
|
|
}
|
|
|
|
fileCheckTest("filecheck_redundant_safepoints_removal") {
|
|
enabled = isExperimentalMM && isCmsGC &&
|
|
project.globalTestArgs.contains("-opt") &&
|
|
!needSmallBinary(project)
|
|
annotatedSource = project.file('filecheck/redundant_safepoints.kt')
|
|
phaseToCheck = "RemoveRedundantSafepoints"
|
|
}
|
|
|
|
fileCheckTest("filecheck_replace_invoke_with_call") {
|
|
annotatedSource = project.file('filecheck/replace_invoke_with_call.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_no_frame_on_constant_object_access") {
|
|
annotatedSource = project.file('filecheck/no_frame_on_constant_object_access.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt49847_simple_function_reference") {
|
|
annotatedSource = project.file('filecheck/kt49847_simple_function_reference.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt49847_sam_Any") {
|
|
annotatedSource = project.file('filecheck/kt49847_sam_Any.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt49847_sam_Int") {
|
|
annotatedSource = project.file('filecheck/kt49847_sam_Int.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt49847_sam_Any_generic") {
|
|
annotatedSource = project.file('filecheck/kt49847_sam_Any_generic.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt49847_sam_Int_generic") {
|
|
annotatedSource = project.file('filecheck/kt49847_sam_Int_generic.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt49847_class") {
|
|
annotatedSource = project.file('filecheck/kt49847_class.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt49847_generic") {
|
|
annotatedSource = project.file('filecheck/kt49847_generic.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt49847_generic_receiver") {
|
|
annotatedSource = project.file('filecheck/kt49847_generic_receiver.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_inline_unbox") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_inline_unbox.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
if (isAppleTarget(project)) {
|
|
checkPrefix = "CHECK-APPLE"
|
|
}
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_noinline_value_unbox") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_noinline_value_unbox.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_noinline_CPointer.kt") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_noinline_CPointer.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_noinline_NativePointed.kt") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_noinline_NativePointed.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_noinline_NonNullNativePtr.kt") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_noinline_NonNullNativePtr.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_noinline_StableRef") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_noinline_StableRef.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_noinline_UByteArray.kt") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_noinline_UByteArray.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_noinline_UIntArray.kt") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_noinline_UIntArray.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_noinline_ULongArray.kt") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_noinline_ULongArray.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53261_noinline_UShortArray.kt") {
|
|
annotatedSource = project.file('filecheck/kt53261/kt53261_noinline_UShortArray.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_intrinsics") {
|
|
annotatedSource = project.file('filecheck/intrinsics.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_default_parameters_dont_box") {
|
|
annotatedSource = project.file('filecheck/default_parameters_dont_box.kt')
|
|
}
|
|
|
|
task kt53119_side_effect(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/stringConcatenationTypeNarrowing/kt53119_side_effect.kt"
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53119_plus_generated_noescape") {
|
|
annotatedSource = project.file('codegen/stringConcatenationTypeNarrowing/kt53119_plus_generated_noescape.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
extraOpts = ["-tr"]
|
|
}
|
|
|
|
task kt53119_plus_generated_noescape(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/stringConcatenationTypeNarrowing/kt53119_plus_generated_noescape.kt"
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53119_plus_member") {
|
|
annotatedSource = project.file('codegen/stringConcatenationTypeNarrowing/kt53119_plus_member.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
extraOpts = ["-tr"]
|
|
}
|
|
|
|
task kt53119_plus_member(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/stringConcatenationTypeNarrowing/kt53119_plus_member.kt"
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53119_plus_extension") {
|
|
annotatedSource = project.file('codegen/stringConcatenationTypeNarrowing/kt53119_plus_extension.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
extraOpts = ["-tr"]
|
|
}
|
|
|
|
task kt53119_plus_extension(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/stringConcatenationTypeNarrowing/kt53119_plus_extension.kt"
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53119_append_generated") {
|
|
annotatedSource = project.file('codegen/stringConcatenationTypeNarrowing/kt53119_append_generated.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
extraOpts = ["-tr"]
|
|
}
|
|
|
|
task kt53119_append_generated(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/stringConcatenationTypeNarrowing/kt53119_append_generated.kt"
|
|
}
|
|
|
|
fileCheckTest("filecheck_kt53119_append_manual") {
|
|
annotatedSource = project.file('codegen/stringConcatenationTypeNarrowing/kt53119_append_manual.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
extraOpts = ["-tr"]
|
|
}
|
|
|
|
task kt53119_append_manual(type: KonanLocalTest) {
|
|
useGoldenData = true
|
|
source = "codegen/stringConcatenationTypeNarrowing/kt53119_append_manual.kt"
|
|
}
|
|
|
|
fileCheckTest("filecheck_escape_analysis_enabled") {
|
|
annotatedSource = project.file('filecheck/escape_analysis.kt')
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
checkPrefix = "CHECK-OPT"
|
|
}
|
|
|
|
fileCheckTest("filecheck_enum_when") {
|
|
// In case of `-opt` we inline Enum.ordinal due to property inlining.
|
|
if (project.globalTestArgs.contains('-opt')) {
|
|
checkPrefix = "CHECK-OPT"
|
|
}
|
|
annotatedSource = project.file('filecheck/enum_when.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_escape_analysis_disabled") {
|
|
annotatedSource = project.file('filecheck/escape_analysis.kt')
|
|
enabled = project.globalTestArgs.contains('-g')
|
|
checkPrefix = "CHECK-DEBUG"
|
|
}
|
|
|
|
fileCheckTest("filecheck_suspend_returnNothing") {
|
|
annotatedSource = project.file('filecheck/suspend_returnNothing.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_suspend_tailcalls_functions") {
|
|
annotatedSource = project.file('filecheck/suspend_tailcalls_functions.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_suspend_tailcalls_lambdas") {
|
|
annotatedSource = project.file('filecheck/suspend_tailcalls_lambdas.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_bce") {
|
|
enabled = enabled && cacheTesting == null
|
|
annotatedSource = project.file('filecheck/bce.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_generic_function_references") {
|
|
enabled = project.globalTestArgs.contains('-opt')
|
|
annotatedSource = project.file('filecheck/generic_function_references.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_adopted_function_reference") {
|
|
annotatedSource = project.file('filecheck/adopted_function_reference.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_single_tls_load") {
|
|
enabled = isExperimentalMM && project.globalTestArgs.contains("-opt")
|
|
annotatedSource = project.file('filecheck/single_tls_load.kt')
|
|
phaseToCheck = "OptimizeTLSDataLoads"
|
|
}
|
|
|
|
fileCheckTest("filecheck_signext_zeroext0") {
|
|
annotatedSource = project.file('filecheck/signext_zeroext0.kt')
|
|
if (project.testTarget == 'mingw_x64') {
|
|
checkPrefix = "CHECK-WINDOWSX64"
|
|
} else if (!target.family.appleFamily && target.architecture == Architecture.ARM64) {
|
|
checkPrefix = "CHECK-AAPCS"
|
|
}
|
|
}
|
|
|
|
createInterop("filecheck_signext_zeroext_interop_input") {
|
|
it.defFile 'filecheck/signext_zeroext_interop_input.def'
|
|
}
|
|
|
|
fileCheckTest("filecheck_signext_zeroext_interop") {
|
|
enabled = enabled && cacheTesting == null
|
|
annotatedSource = project.file('filecheck/signext_zeroext_interop.kt')
|
|
interop = "filecheck_signext_zeroext_interop_input"
|
|
if (project.testTarget == 'mingw_x64') {
|
|
checkPrefix = "CHECK-WINDOWSX64"
|
|
} else if (!target.family.appleFamily && target.architecture == Architecture.ARM64) {
|
|
checkPrefix = "CHECK-AAPCS"
|
|
}
|
|
}
|
|
|
|
fileCheckTest("filecheck_signext_zeroext_objc_export") {
|
|
annotatedSource = project.file('filecheck/signext_zeroext_objc_export.kt')
|
|
generateFramework = true
|
|
enabled = target.family.appleFamily
|
|
}
|
|
|
|
fileCheckTest("filecheck_function_attributes_at_callsite") {
|
|
enabled = (project.testTarget != 'wasm32') // KT-49739
|
|
// attributes for caller and callee might be the same so we allow overlapping.
|
|
additionalFileCheckFlags = ["--allow-deprecated-dag-overlap"]
|
|
annotatedSource = project.file('filecheck/function_attributes_at_callsite.kt')
|
|
}
|
|
|
|
fileCheckTest("filecheck_constants_merge") {
|
|
annotatedSource = project.file('filecheck/constants_merge.kt')
|
|
}
|
|
|
|
|
|
fileCheckTest("filecheck_objc_direct") {
|
|
enabled = enabled && cacheTesting == null
|
|
annotatedSource = project.file('filecheck/objc_direct.kt')
|
|
interop = "objcDirect"
|
|
enabled = target.family.appleFamily
|
|
}
|
|
|
|
|
|
dependencies {
|
|
nopPluginApi kotlinCompilerModule
|
|
nopPluginApi project(":native:kotlin-native-utils")
|
|
nopPluginApi project(":core:descriptors")
|
|
nopPluginApi project(":compiler:ir.tree")
|
|
nopPluginApi project(":compiler:ir.backend.common")
|
|
nopPluginApi project(":compiler:util")
|
|
nopPluginApi project(":native:frontend.native")
|
|
nopPluginApi project(":compiler:cli-common")
|
|
nopPluginApi project(":compiler:cli-base")
|
|
nopPluginApi project(":compiler:cli")
|
|
nopPluginApi project(":kotlin-util-klib")
|
|
nopPluginApi project(":kotlin-util-klib-metadata")
|
|
nopPluginApi project(":compiler:ir.serialization.common")
|
|
|
|
implementation kotlinCompilerModule
|
|
api project(path: ':kotlin-native:backend.native', configuration: 'cli_bcApiElements')
|
|
api DependenciesKt.commonDependency(project, "junit")
|
|
}
|
|
|
|
// Configure build for iOS device targets.
|
|
if (UtilsKt.supportsRunningTestsOnDevice(target) && !UtilsKt.getCompileOnlyTests(project)) {
|
|
project.tasks
|
|
.withType(KonanTestExecutable.class)
|
|
.configureEach {
|
|
ExecutorServiceKt.configureXcodeBuild((KonanTestExecutable) it)
|
|
}
|
|
// Exclude tasks that cannot be run on device
|
|
project.tasks
|
|
.withType(KonanTest.class)
|
|
.matching { (it instanceof KonanLocalTest && ((KonanLocalTest) it).useTestData) ||
|
|
// Filter out tests that depend on libs. TODO: copy them too
|
|
it instanceof KonanInteropTest ||
|
|
it instanceof KonanDynamicTest ||
|
|
it instanceof KonanLinkTest
|
|
}
|
|
.configureEach { it.enabled = false }
|
|
}
|
|
|
|
project.afterEvaluate {
|
|
// Don't treat any task as up-to-date, no matter what.
|
|
// Note: this project should contain only test tasks, including ones that build binaries,
|
|
// and ones that run binaries.
|
|
// So the configuration below mostly means "tests aren't up-to-date".
|
|
tasks.configureEach {
|
|
outputs.upToDateWhen { false }
|
|
}
|
|
}
|