tests: Support custom konan.home for platform lib tests
* Move testLibrary tasks from klib into backend.native/tests * Support konan.home property in them
This commit is contained in:
+1
-30
@@ -23,33 +23,4 @@ apply plugin: 'kotlin'
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
||||
compile project(path: ':backend.native', configuration: 'cli_bc')
|
||||
}
|
||||
|
||||
def dist = distDir.absolutePath
|
||||
def suffix = isWindows() ? ".bat" : ""
|
||||
|
||||
// TODO: Ideally we want to write just konanArtifacts{} clause here,
|
||||
// but we need to make Kotlin/Native Gradle Plugin a dependence
|
||||
// of our buildScripts first.
|
||||
task compileKonanTestLibrary(type: Exec) {
|
||||
dependsOn ':dist'
|
||||
|
||||
def compiler = "$dist/bin/konanc$suffix"
|
||||
def source = 'src/testLibrary'
|
||||
def artifact = 'build/konan/bin/testLibrary'
|
||||
|
||||
executable compiler
|
||||
args source, '-o', artifact, '-p', 'library'
|
||||
}
|
||||
|
||||
task installTestLibrary(type: Exec) {
|
||||
dependsOn 'compileKonanTestLibrary'
|
||||
|
||||
def tool = "$dist/bin/klib$suffix"
|
||||
def repo = "$dist/klib/common"
|
||||
def library = 'build/konan/bin/testLibrary.klib'
|
||||
|
||||
executable tool
|
||||
args 'install', library, '-repository', repo
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package test.konan.platform
|
||||
|
||||
fun produceMessage() {
|
||||
println("""This is a side effect of a test library linked into the binary.
|
||||
You should not be seeing this.
|
||||
""")
|
||||
}
|
||||
|
||||
val x: Unit = produceMessage()
|
||||
Reference in New Issue
Block a user