Support friend modules in external tests
This commit is contained in:
committed by
Pavel Punegov
parent
90d4246d22
commit
269f6f5493
@@ -514,9 +514,13 @@ fun runTest() {
|
|||||||
if (!module.isDefaultModule()) {
|
if (!module.isDefaultModule()) {
|
||||||
def klibModulePath = "${executablePath()}.${module.name}.klib"
|
def klibModulePath = "${executablePath()}.${module.name}.klib"
|
||||||
libs.addAll(module.dependencies)
|
libs.addAll(module.dependencies)
|
||||||
|
def klibs = libs.collectMany { ["-l", "${executablePath()}.${it}.klib"] }.toList()
|
||||||
|
def friends = module.friends ?
|
||||||
|
module.friends.collectMany {
|
||||||
|
["-friend-modules", "${executablePath()}.${it}.klib"]
|
||||||
|
}.toList() : []
|
||||||
runCompiler(compileList.findAll { it.module == module }.collect { it.path },
|
runCompiler(compileList.findAll { it.module == module }.collect { it.path },
|
||||||
klibModulePath, flags + ["-p", "library"] +
|
klibModulePath, flags + ["-p", "library"] + klibs + friends)
|
||||||
libs.collectMany { ["-l", "${executablePath()}.${it}.klib"] }.toList())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -526,8 +530,13 @@ fun runTest() {
|
|||||||
compileMain.forEach { f ->
|
compileMain.forEach { f ->
|
||||||
libs.addAll(f.module.dependencies)
|
libs.addAll(f.module.dependencies)
|
||||||
}
|
}
|
||||||
if (!compileMain.empty) runCompiler(compileMain.collect { it.path }, executablePath(),
|
def friends = compileMain.collectMany {it.module.friends }.toSet()
|
||||||
flags + libs.collectMany { ["-l", "${executablePath()}.${it}.klib"] }.toList())
|
if (!compileMain.empty) {
|
||||||
|
runCompiler(compileMain.collect { it.path }, executablePath(), flags +
|
||||||
|
libs.collectMany { ["-l", "${executablePath()}.${it}.klib"] }.toList() +
|
||||||
|
friends.collectMany {["-friend-modules", "${executablePath()}.${it}.klib"]}.toList()
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
project.logger.quiet("ERROR: Compilation failed for test suite: $name with exception", ex)
|
project.logger.quiet("ERROR: Compilation failed for test suite: $name with exception", ex)
|
||||||
|
|||||||
Reference in New Issue
Block a user