[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)
|
task.configure(configureClosure)
|
||||||
if (task.enabled) {
|
if (task.enabled) {
|
||||||
konanArtifacts {
|
konanArtifacts {
|
||||||
def lib = task.interop
|
def targetName = target.name
|
||||||
UtilsKt.dependsOnKonanBuildingTask(task, lib, target)
|
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 {
|
libraries {
|
||||||
artifact lib
|
artifact interopLib
|
||||||
|
if (hasIntermediateLib)
|
||||||
|
klib lib
|
||||||
}
|
}
|
||||||
srcFiles multiFile ? fileTree(task.source) { include '**/*.kt' } : task.getSources()
|
srcFiles multiFile ? fileTree(task.source) { include '**/*.kt' } : task.getSources()
|
||||||
baseDir "$testOutputLocal/$name"
|
baseDir "$testOutputLocal/$name"
|
||||||
|
|||||||
@@ -471,6 +471,10 @@ open class KonanInteropTest : KonanStandaloneTest() {
|
|||||||
*/
|
*/
|
||||||
@Input
|
@Input
|
||||||
lateinit var interop: String
|
lateinit var interop: String
|
||||||
|
|
||||||
|
@Input
|
||||||
|
@Optional
|
||||||
|
var lib: String? = null
|
||||||
}
|
}
|
||||||
|
|
||||||
open class KonanLinkTest : KonanStandaloneTest() {
|
open class KonanLinkTest : KonanStandaloneTest() {
|
||||||
|
|||||||
Reference in New Issue
Block a user