[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:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user