gradle-plugin: Add path test
This commit is contained in:
+6
-6
@@ -116,8 +116,6 @@ class IncrementalSpecification extends Specification {
|
||||
"enableAssertions" | "enableAssertions()"
|
||||
"enableDebug" | "enableDebug true"
|
||||
"outputName" | "outputName 'foo'"
|
||||
|
||||
|
||||
}
|
||||
|
||||
def 'inputFiles change for a compilation task should cause only recompilation'() {
|
||||
@@ -305,8 +303,13 @@ class IncrementalSpecification extends Specification {
|
||||
} else {
|
||||
throw new IllegalStateException("Unknown host platform")
|
||||
}
|
||||
def project = KonanInteropProject.createEmpty(tmpFolder) { KonanInteropProject it ->
|
||||
it.generateSrcFile('main.kt')
|
||||
it.propertiesFile.append("konan.build.targets=all\n")
|
||||
}
|
||||
|
||||
def results = buildTwiceEmpty { KonanInteropProject project ->
|
||||
|
||||
def results = buildTwice(project) { KonanInteropProject it ->
|
||||
project.buildFile.append("konanArtifacts['main'].target '$newTarget'\n")
|
||||
project.buildFile.append("konanInterop['stdio'].target '$newTarget'\n")
|
||||
}
|
||||
@@ -315,8 +318,5 @@ class IncrementalSpecification extends Specification {
|
||||
recompilationAndInteropProcessingHappened(*results)
|
||||
}
|
||||
|
||||
|
||||
//endregion
|
||||
}
|
||||
|
||||
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package org.jetbrains.kotlin.gradle.plugin.test
|
||||
|
||||
import org.junit.Rule
|
||||
import org.junit.rules.TemporaryFolder
|
||||
import spock.lang.Specification
|
||||
|
||||
|
||||
class PathSpecification extends Specification {
|
||||
@Rule
|
||||
TemporaryFolder tmpFolder = new TemporaryFolder()
|
||||
|
||||
def 'Plugin should create all necessary directories'() {
|
||||
when:
|
||||
def project = KonanInteropProject.create(tmpFolder)
|
||||
def result = project.createRunner().withArguments('build').build()
|
||||
|
||||
then:
|
||||
def konan = "${tmpFolder.root}/build/konan"
|
||||
new File("$konan/bin").listFiles().findAll {
|
||||
File it -> it.file && it.name.matches('^main\\.[^.]+')
|
||||
}.size() > 0
|
||||
def klib = new File("$konan/interopCompiledStubs/stdioInteropStubs/stdioInteropStubs.klib")
|
||||
klib.exists() && klib.file
|
||||
def stdioKt = new File("$konan/interopStubs/genStdioInteropStubs/stdio/stdio.kt")
|
||||
stdioKt.exists() && stdioKt.file
|
||||
def manifest = new File("$konan/interopStubs/genStdioInteropStubs/manifest.properties")
|
||||
manifest.exists() && manifest.file
|
||||
def nativeLib = new File("$konan/nativelibs/genStdioInteropStubs/stdiostubs.bc")
|
||||
nativeLib.exists() && nativeLib.file
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user