[K/N][tests] Possible intermediate library for interop test

Now along with earlier [interop] <- [main] scheme one can also use
[interop] <- [lib] <- [main] which previously was only for link tests
This commit is contained in:
Igor Chevdar
2022-04-27 10:47:01 +05:00
committed by Space
parent ba9c2e51a7
commit 2b75ba203a
2 changed files with 27 additions and 4 deletions
@@ -4365,12 +4365,31 @@ Task interopTestBase(String name, boolean multiFile, Closure<KonanInteropTest> c
task.configure(configureClosure)
if (task.enabled) {
konanArtifacts {
def lib = task.interop
UtilsKt.dependsOnKonanBuildingTask(task, lib, target)
def targetName = target.name
def interopLib = task.interop
UtilsKt.dependsOnKonanBuildingTask(task, interopLib, target)
program(name, targets: [target.name]) {
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
}
srcFiles task.lib
baseDir "$testOutputLocal/$name"
extraOpts task.flags
extraOpts project.globalTestArgs
}
UtilsKt.dependsOnKonanBuildingTask(task, lib, target)
}
program(name, targets: [targetName]) {
libraries {
artifact lib
artifact interopLib
if (hasIntermediateLib)
klib lib
}
srcFiles multiFile ? fileTree(task.source) { include '**/*.kt' } : task.getSources()
baseDir "$testOutputLocal/$name"
@@ -471,6 +471,10 @@ open class KonanInteropTest : KonanStandaloneTest() {
*/
@Input
lateinit var interop: String
@Input
@Optional
var lib: String? = null
}
open class KonanLinkTest : KonanStandaloneTest() {