aboutsummaryrefslogtreecommitdiff
path: root/integration-tests/gradle/src/integrationTest
diff options
context:
space:
mode:
authorKamil Doległo <kamilok1965@interia.pl>2020-09-16 09:29:25 +0200
committerKamil Doległo <9080183+kamildoleglo@users.noreply.github.com>2020-11-13 19:46:36 +0100
commit1a552c1f64fc15a94c298e50a3dd614f3794c0e3 (patch)
tree5aab050b712775ef98da5041e673100c75f9ee56 /integration-tests/gradle/src/integrationTest
parente03aed7331756eaef766c7306bd033c84f7fd815 (diff)
downloaddokka-1a552c1f64fc15a94c298e50a3dd614f3794c0e3.tar.gz
dokka-1a552c1f64fc15a94c298e50a3dd614f3794c0e3.tar.bz2
dokka-1a552c1f64fc15a94c298e50a3dd614f3794c0e3.zip
Add integration tests for Kotlin projects
Diffstat (limited to 'integration-tests/gradle/src/integrationTest')
-rw-r--r--integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/CoroutinesGradleIntegrationTest.kt50
-rw-r--r--integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/SerializationGradleIntegrationTest.kt49
-rw-r--r--integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/StdlibGradleIntegrationTest.kt50
3 files changed, 149 insertions, 0 deletions
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/CoroutinesGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/CoroutinesGradleIntegrationTest.kt
new file mode 100644
index 00000000..b4978ea9
--- /dev/null
+++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/CoroutinesGradleIntegrationTest.kt
@@ -0,0 +1,50 @@
+package org.jetbrains.dokka.it.gradle.kotlin
+
+import org.gradle.testkit.runner.TaskOutcome
+import org.jetbrains.dokka.it.S3Project
+import org.jetbrains.dokka.it.copyAndApplyGitDiff
+import org.jetbrains.dokka.it.gradle.*
+import org.junit.runners.Parameterized
+import java.io.File
+import kotlin.test.*
+
+class CoroutinesGradleIntegrationTest(override val versions: BuildVersions) : AbstractGradleIntegrationTest(),
+ S3Project {
+
+ companion object {
+ @get:JvmStatic
+ @get:Parameterized.Parameters(name = "{0}")
+ val versions = BuildVersions.permutations(
+ gradleVersions = listOf("6.3"),
+ kotlinVersions = listOf("1.4.10")
+ )
+ }
+
+ override val projectOutputLocation: File by lazy { File(projectDir, "build/dokka/htmlMultiModule") }
+
+ @BeforeTest
+ fun prepareProjectFiles() {
+ val templateProjectDir = File("projects", "coroutines/kotlinx-coroutines")
+ templateProjectDir.listFiles().orEmpty()
+ .forEach { topLevelFile -> topLevelFile.copyRecursively(File(projectDir, topLevelFile.name)) }
+
+ copyAndApplyGitDiff(File("projects", "coroutines/coroutines.diff"))
+ }
+
+ @Test
+ fun execute() {
+ val result = createGradleRunner(":dokkaHtmlMultiModule", "-i", "-s").buildRelaxed()
+
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":dokkaHtmlMultiModule")).outcome)
+
+ assertTrue(projectOutputLocation.isDirectory, "Missing dokka output directory")
+
+ projectOutputLocation.allHtmlFiles().forEach { file ->
+// assertContainsNoErrorClass(file)
+// assertNoUnresolvedLinks(file)
+// assertNoHrefToMissingLocalFileOrDirectory(file)
+ assertNoEmptyLinks(file)
+ assertNoEmptySpans(file)
+ }
+ }
+}
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/SerializationGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/SerializationGradleIntegrationTest.kt
new file mode 100644
index 00000000..e097369f
--- /dev/null
+++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/SerializationGradleIntegrationTest.kt
@@ -0,0 +1,49 @@
+package org.jetbrains.dokka.it.gradle.kotlin
+
+import org.gradle.testkit.runner.TaskOutcome
+import org.jetbrains.dokka.it.S3Project
+import org.jetbrains.dokka.it.copyAndApplyGitDiff
+import org.jetbrains.dokka.it.gradle.*
+import org.junit.runners.Parameterized
+import java.io.File
+import kotlin.test.*
+
+class SerializationGradleIntegrationTest(override val versions: BuildVersions) : AbstractGradleIntegrationTest(),
+ S3Project {
+
+ companion object {
+ @get:JvmStatic
+ @get:Parameterized.Parameters(name = "{0}")
+ val versions = BuildVersions.permutations(
+ gradleVersions = listOf("6.3"),
+ kotlinVersions = listOf("1.4.10")
+ )
+ }
+
+ override val projectOutputLocation: File by lazy { File(projectDir, "build/dokka/htmlMultiModule") }
+
+ @BeforeTest
+ fun prepareProjectFiles() {
+ val templateProjectDir = File("projects", "serialization/kotlinx-serialization")
+ templateProjectDir.listFiles().orEmpty()
+ .forEach { topLevelFile -> topLevelFile.copyRecursively(File(projectDir, topLevelFile.name)) }
+ copyAndApplyGitDiff(File("projects", "serialization/serialization.diff"))
+ }
+
+ @Test
+ fun execute() {
+ val result = createGradleRunner(":dokkaHtmlMultiModule", "-i", "-s").buildRelaxed()
+
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":dokkaHtmlMultiModule")).outcome)
+
+ assertTrue(projectOutputLocation.isDirectory, "Missing dokka output directory")
+
+ projectOutputLocation.allHtmlFiles().forEach { file ->
+ assertContainsNoErrorClass(file)
+ assertNoUnresolvedLinks(file)
+// assertNoHrefToMissingLocalFileOrDirectory(file)
+ assertNoEmptyLinks(file)
+ assertNoEmptySpans(file)
+ }
+ }
+}
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/StdlibGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/StdlibGradleIntegrationTest.kt
new file mode 100644
index 00000000..ca768962
--- /dev/null
+++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/kotlin/StdlibGradleIntegrationTest.kt
@@ -0,0 +1,50 @@
+package org.jetbrains.dokka.it.gradle.kotlin
+
+import org.gradle.testkit.runner.TaskOutcome
+import org.jetbrains.dokka.it.S3Project
+import org.jetbrains.dokka.it.copyAndApplyGitDiff
+import org.jetbrains.dokka.it.gradle.*
+import org.junit.runners.Parameterized
+import java.io.File
+import kotlin.test.*
+
+class StdlibGradleIntegrationTest(override val versions: BuildVersions) : AbstractGradleIntegrationTest(),
+ S3Project {
+
+ companion object {
+ @get:JvmStatic
+ @get:Parameterized.Parameters(name = "{0}")
+ val versions = BuildVersions.permutations(
+ gradleVersions = listOf("5.6"),
+ kotlinVersions = listOf("1.4.10")
+ )
+ }
+
+ override val projectOutputLocation: File by lazy { File(projectDir, "build/dokka/kotlin-stdlib") }
+
+ @BeforeTest
+ fun prepareProjectFiles() {
+ val templateProjectDir = File("projects", "stdlib/kotlin-dokka-stdlib")
+ templateProjectDir.listFiles().orEmpty()
+ .forEach { topLevelFile -> topLevelFile.copyRecursively(File(projectDir, topLevelFile.name)) }
+
+ copyAndApplyGitDiff(File("projects", "stdlib/stdlib.diff"))
+ }
+
+ @Test
+ fun execute() {
+ val result = createGradleRunner("callDokka", "-i", "-s").buildRelaxed()
+
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":callDokka")).outcome)
+
+ assertTrue(projectOutputLocation.isDirectory, "Missing dokka output directory")
+
+ projectOutputLocation.allHtmlFiles().forEach { file ->
+ assertContainsNoErrorClass(file)
+// assertNoUnresolvedLinks(file)
+// assertNoHrefToMissingLocalFileOrDirectory(file)
+ assertNoEmptyLinks(file)
+ assertNoEmptySpans(file)
+ }
+ }
+}