diff options
author | sebastian.sellmair <sebastian.sellmair@jetbrains.com> | 2020-07-20 14:20:17 +0200 |
---|---|---|
committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-07-20 16:37:49 +0200 |
commit | f39971875c4f7d98dc1add2a8ed949d22b25600b (patch) | |
tree | 222ff081a1ab54b2ef1f164c52e9312004581202 /integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka | |
parent | ac649efd3190237e22d79b59db436a4511f5e1b7 (diff) | |
download | dokka-f39971875c4f7d98dc1add2a8ed949d22b25600b.tar.gz dokka-f39971875c4f7d98dc1add2a8ed949d22b25600b.tar.bz2 dokka-f39971875c4f7d98dc1add2a8ed949d22b25600b.zip |
Re-introduce default DokkaCollectorTask, run on all submodules by default, add Collector0IntegrationTest
Diffstat (limited to 'integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka')
6 files changed, 86 insertions, 7 deletions
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt index 2a9d7a70..92ea4c3e 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt @@ -64,7 +64,7 @@ class Android0GradleIntegrationTest(override val versions: BuildVersions) : Abst htmlOutputDir.allHtmlFiles().forEach { file -> assertContainsNoErrorClass(file) - assertNoUnresolvedLInks(file) + assertNoUnresolvedLinks(file) assertNoHrefToMissingLocalFileOrDirectory(file) } diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt index 30b560e7..d31c23b6 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt @@ -37,13 +37,13 @@ class BasicGradleIntegrationTest(override val versions: BuildVersions) : Abstrac assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":dokkaGfm")).outcome) assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":dokkaJekyll")).outcome) - File(projectDir, "build/dokka/html").assertKdocOutputDir() + File(projectDir, "build/dokka/html").assertHtmlOutputDir() File(projectDir, "build/dokka/javadoc").assertJavadocOutputDir() File(projectDir, "build/dokka/gfm").assertGfmOutputDir() File(projectDir, "build/dokka/jekyll").assertJekyllOutputDir() } - private fun File.assertKdocOutputDir() { + private fun File.assertHtmlOutputDir() { assertTrue(isDirectory, "Missing dokka html output directory") val imagesDir = File(this, "images") @@ -75,7 +75,7 @@ class BasicGradleIntegrationTest(override val versions: BuildVersions) : Abstrac allHtmlFiles().forEach { file -> assertContainsNoErrorClass(file) - assertNoUnresolvedLInks(file) + assertNoUnresolvedLinks(file) assertNoHrefToMissingLocalFileOrDirectory(file) } diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGroovyIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGroovyIntegrationTest.kt index 92b7ec40..24e105df 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGroovyIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGroovyIntegrationTest.kt @@ -79,7 +79,7 @@ class BasicGroovyIntegrationTest(override val versions: BuildVersions) : Abstrac allHtmlFiles().forEach { file -> assertContainsNoErrorClass(file) - assertNoUnresolvedLInks(file) + assertNoUnresolvedLinks(file) assertNoHrefToMissingLocalFileOrDirectory(file) } } diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Collector0IntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Collector0IntegrationTest.kt new file mode 100644 index 00000000..9866712d --- /dev/null +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Collector0IntegrationTest.kt @@ -0,0 +1,79 @@ +package org.jetbrains.dokka.it.gradle + +import org.gradle.testkit.runner.TaskOutcome +import org.junit.runners.Parameterized +import java.io.File +import kotlin.test.* + +class Collector0IntegrationTest(override val versions: BuildVersions) : AbstractGradleIntegrationTest() { + companion object { + @get:JvmStatic + @get:Parameterized.Parameters(name = "{0}") + val versions = BuildVersions.permutations( + gradleVersions = listOf("6.5.1", "6.1.1"), + kotlinVersions = listOf("1.4-M3") + ) + } + + @BeforeTest + fun prepareProjectFiles() { + val templateProjectDir = File("projects", "it-collector-0") + templateProjectDir.listFiles().orEmpty() + .filter { it.isFile } + .forEach { topLevelFile -> topLevelFile.copyTo(File(projectDir, topLevelFile.name)) } + File(templateProjectDir, "moduleA").copyRecursively(File(projectDir, "moduleA")) + } + + @Test + fun execute() { + val result = createGradleRunner( + ":moduleA:dokkaHtmlCollector", + ":moduleA:dokkaJavadocCollector", + ":moduleA:dokkaGfmCollector", + ":moduleA:dokkaJekyllCollector", + "-i", "-s" + ).buildRelaxed() + + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaHtmlCollector")).outcome) + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaJavadocCollector")).outcome) + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaGfmCollector")).outcome) + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaJekyllCollector")).outcome) + + File(projectDir, "moduleA/build/dokka/htmlCollector").assertHtmlOutputDir() + File(projectDir, "moduleA/build/dokka/javadocCollector").assertJavadocOutputDir() + File(projectDir, "moduleA/build/dokka/gfmCollector").assertGfmOutputDir() + File(projectDir, "moduleA/build/dokka/jekyllCollector").assertJekyllOutputDir() + } + + private fun File.assertHtmlOutputDir() { + assertTrue(isDirectory, "Missing dokka htmlCollector output directory") + allHtmlFiles().forEach { file -> + assertContainsNoErrorClass(file) + assertNoUnresolvedLinks(file) + assertNoHrefToMissingLocalFileOrDirectory(file) + } + + assertTrue( + allHtmlFiles().any { file -> "moduleB" in file.readText() }, + "Expected moduleB to be present in html" + ) + + assertTrue( + allHtmlFiles().any { file -> "moduleC" in file.readText() }, + "Expected moduleC to be present in html" + ) + } + + private fun File.assertJavadocOutputDir() { + assertTrue(isDirectory, "Missing dokka javadocCollector output directory") + } + + private fun File.assertJekyllOutputDir() { + assertTrue(isDirectory, "Missing dokka jekyllCollector output directory") + } + + private fun File.assertGfmOutputDir() { + assertTrue(isDirectory, "Missing dokka gfmCollector output directory") + } +} + diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multimodule0IntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multimodule0IntegrationTest.kt index 390db3a0..91afeaa0 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multimodule0IntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multimodule0IntegrationTest.kt @@ -40,7 +40,7 @@ class Multimodule0IntegrationTest(override val versions: BuildVersions) : Abstra outputDir.allHtmlFiles().forEach { file -> assertContainsNoErrorClass(file) - assertNoUnresolvedLInks(file) + assertNoUnresolvedLinks(file) assertNoHrefToMissingLocalFileOrDirectory(file) } diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multiplatform0GradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multiplatform0GradleIntegrationTest.kt index 6a3b9c83..ae0f342c 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multiplatform0GradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multiplatform0GradleIntegrationTest.kt @@ -36,7 +36,7 @@ class Multiplatform0GradleIntegrationTest(override val versions: BuildVersions) dokkaOutputDir.allHtmlFiles().forEach { file -> assertContainsNoErrorClass(file) - assertNoUnresolvedLInks(file) + assertNoUnresolvedLinks(file) assertNoHrefToMissingLocalFileOrDirectory(file) } } |