aboutsummaryrefslogtreecommitdiff
path: root/runners/gradle-integration-tests/src/test/kotlin
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2019-09-09 16:30:41 +0200
committerKamil Doległo <kamilok1965@interia.pl>2019-09-09 16:31:55 +0200
commitdb33337316392f3aacf16943369fbbe1af2f117d (patch)
treeb9d23a9379c563f98d4bce868f715b494b349178 /runners/gradle-integration-tests/src/test/kotlin
parent00c8b625b547dd01e8038a3b70a62514983c6974 (diff)
downloaddokka-db33337316392f3aacf16943369fbbe1af2f117d.tar.gz
dokka-db33337316392f3aacf16943369fbbe1af2f117d.tar.bz2
dokka-db33337316392f3aacf16943369fbbe1af2f117d.zip
Add a test for multiplatform and kotlinTasks
Diffstat (limited to 'runners/gradle-integration-tests/src/test/kotlin')
-rw-r--r--runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt54
1 files changed, 54 insertions, 0 deletions
diff --git a/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt
new file mode 100644
index 00000000..3e61d79e
--- /dev/null
+++ b/runners/gradle-integration-tests/src/test/kotlin/org/jetbrains/dokka/gradle/MultiplatformProjectTest.kt
@@ -0,0 +1,54 @@
+package org.jetbrains.dokka.gradle
+
+import org.gradle.testkit.runner.TaskOutcome
+import org.junit.Test
+import java.io.File
+import kotlin.test.assertEquals
+
+class MultiplatformProjectTest : AbstractDokkaGradleTest() {
+
+ fun prepareTestData(testDataRootPath: String) {
+ val testDataRoot = testDataFolder.resolve(testDataRootPath)
+ val tmpRoot = testProjectDir.root.toPath()
+
+ testDataRoot.apply {
+ resolve("build.gradle").copy(tmpRoot.resolve("build.gradle"))
+ resolve("settings.gradle").copy(tmpRoot.resolve("settings.gradle"))
+ resolve("src").copy(tmpRoot.resolve("src"))
+ }
+ }
+
+ private fun doTest(gradleVersion: String, kotlinVersion: String) {
+ val kotlinGradlePlugin = pluginClasspathData.resolveSibling("kotlin-gradle.txt").toFile().readLines().map { File(it) }
+ prepareTestData("multiplatformProject")
+
+ // Remove withDebug(false) when https://github.com/gradle/gradle/issues/6862 is solved
+ val result = configure(gradleVersion, kotlinVersion, arguments = arrayOf("dokka", "--stacktrace"))
+ .withDebug(false)
+ .withPluginClasspath(pluginClasspath.union(kotlinGradlePlugin))
+ .build()
+
+ println(result.output)
+
+ assertEquals(TaskOutcome.SUCCESS, result.task(":dokka")?.outcome)
+
+ val docsOutput = "build/dokka"
+
+ checkOutputStructure("multiplatformProject/fileTree.txt", docsOutput)
+
+ checkNoErrorClasses(docsOutput)
+ checkNoUnresolvedLinks(docsOutput)
+ }
+
+ @Test fun `test kotlin 1_3_30 and gradle 4_7`() {
+ doTest("4.7", "1.3.30")
+ }
+
+ @Test fun `test kotlin 1_3_40 and gradle 4_10_3`() {
+ doTest("4.10.3", "1.3.40")
+ }
+
+ @Test fun `test kotlin 1_3_40 and gradle 5_6_1`() {
+ doTest("5.6.1", "1.3.50")
+ }
+} \ No newline at end of file