aboutsummaryrefslogtreecommitdiff
path: root/integration-tests/gradle/src
diff options
context:
space:
mode:
authorvmishenev <vad-mishenev@yandex.ru>2021-09-28 18:46:49 +0300
committerGitHub <noreply@github.com>2021-09-28 18:46:49 +0300
commit78f25296ad967cba3cfd5bc28a3fd4f5950f5ca0 (patch)
treeb466475e15a857a8f1d0811a4935bcff1633466d /integration-tests/gradle/src
parent1b1b5e70f9220a49801729aff5e43883014fe1d4 (diff)
downloaddokka-78f25296ad967cba3cfd5bc28a3fd4f5950f5ca0.tar.gz
dokka-78f25296ad967cba3cfd5bc28a3fd4f5950f5ca0.tar.bz2
dokka-78f25296ad967cba3cfd5bc28a3fd4f5950f5ca0.zip
Support JS KLib (#2159)
Diffstat (limited to 'integration-tests/gradle/src')
-rw-r--r--integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/JsIRGradleIntegrationTest.kt60
1 files changed, 60 insertions, 0 deletions
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/JsIRGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/JsIRGradleIntegrationTest.kt
new file mode 100644
index 00000000..81beccee
--- /dev/null
+++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/JsIRGradleIntegrationTest.kt
@@ -0,0 +1,60 @@
+package org.jetbrains.dokka.it.gradle
+
+import org.gradle.testkit.runner.TaskOutcome
+import org.junit.runners.Parameterized.Parameters
+import java.io.File
+import kotlin.test.*
+
+class JsIRGradleIntegrationTest(override val versions: BuildVersions) : AbstractGradleIntegrationTest() {
+
+ companion object {
+ @get:JvmStatic
+ @get:Parameters(name = "{0}")
+ val versions = BuildVersions.permutations(
+ gradleVersions = listOf("7.2", *ifExhaustive("7.0")),
+ kotlinVersions = listOf("1.5.0", "1.5.30")
+ )
+ }
+
+ val reactVersionArg = mapOf(
+ "1.5.0" to "-Pdokka_it_react_kotlin_version=5.2.0-pre.202-kotlin-1.5.0",
+ "1.5.30" to "-Pdokka_it_react_kotlin_version=5.2.0-pre.246-kotlin-1.5.30"
+ )
+
+ @BeforeTest
+ fun prepareProjectFiles() {
+ val templateProjectDir = File("projects", "it-js-ir-0")
+
+ templateProjectDir.listFiles().orEmpty()
+ .filter { it.isFile }
+ .filterNot { it.name == "local.properties" }
+ .filterNot { it.name.startsWith("gradlew") }
+ .forEach { topLevelFile -> topLevelFile.copyTo(File(projectDir, topLevelFile.name)) }
+
+ File(templateProjectDir, "src").copyRecursively(File(projectDir, "src"))
+ }
+
+ @Test
+ fun execute() {
+ val reactPropertyArg = reactVersionArg[versions.kotlinVersion]
+ ?: throw IllegalStateException("Unspecified version of react for kotlin " + versions.kotlinVersion)
+ val result = createGradleRunner(reactPropertyArg, "dokkaHtml", "-i", "-s").buildRelaxed()
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":dokkaHtml")).outcome)
+
+ val htmlOutputDir = File(projectDir, "build/dokka/html")
+ assertTrue(htmlOutputDir.isDirectory, "Missing html output directory")
+
+ assertTrue(
+ htmlOutputDir.allHtmlFiles().count() > 0,
+ "Expected html files in html output directory"
+ )
+
+ htmlOutputDir.allHtmlFiles().forEach { file ->
+ assertContainsNoErrorClass(file)
+ assertNoHrefToMissingLocalFileOrDirectory(file)
+ assertNoUnresolvedLinks(file)
+ assertNoEmptyLinks(file)
+ assertNoEmptySpans(file)
+ }
+ }
+} \ No newline at end of file