From 7a680acb011e38c66e2039cd5d831a49b16546ad Mon Sep 17 00:00:00 2001 From: Igor Yakovlev Date: Wed, 25 Jan 2023 19:03:21 +0100 Subject: Support kotlin wasm target --- .../dokka/it/gradle/WasmGradleIntegrationTest.kt | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/WasmGradleIntegrationTest.kt (limited to 'integration-tests/gradle/src/integrationTest/kotlin/org') diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/WasmGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/WasmGradleIntegrationTest.kt new file mode 100644 index 00000000..f4774dff --- /dev/null +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/WasmGradleIntegrationTest.kt @@ -0,0 +1,50 @@ +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 WasmGradleIntegrationTest(override val versions: BuildVersions) : AbstractGradleIntegrationTest() { + + companion object { + @get:JvmStatic + @get:Parameters(name = "{0}") + val versions = listOf(TestedVersions.LATEST) + } + + @BeforeTest + fun prepareProjectFiles() { + val templateProjectDir = File("projects", "it-wasm-basic") + + 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 result = createGradleRunner("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) + } + } +} -- cgit