diff options
author | Kamil Doległo <kamilok1965@interia.pl> | 2020-09-08 00:13:55 +0200 |
---|---|---|
committer | Błażej Kardyś <bkardys@virtuslab.com> | 2020-09-30 13:43:08 +0200 |
commit | dafa895f8c683973cc6050327fb01729fc53f467 (patch) | |
tree | fcfb810fecdbcf621644511a29a6c6c97c897621 /integration-tests/gradle/src/integrationTest/kotlin | |
parent | f8e1428a3235dae9fca9faaa4837313693d6456f (diff) | |
download | dokka-dafa895f8c683973cc6050327fb01729fc53f467.tar.gz dokka-dafa895f8c683973cc6050327fb01729fc53f467.tar.bz2 dokka-dafa895f8c683973cc6050327fb01729fc53f467.zip |
Add integration test for linking between projects
Diffstat (limited to 'integration-tests/gradle/src/integrationTest/kotlin')
-rw-r--r-- | integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule1IntegrationTest.kt | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule1IntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule1IntegrationTest.kt new file mode 100644 index 00000000..02c87f20 --- /dev/null +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule1IntegrationTest.kt @@ -0,0 +1,56 @@ +package org.jetbrains.dokka.it.gradle + +import org.gradle.testkit.runner.TaskOutcome +import org.junit.runners.Parameterized +import java.io.File +import kotlin.test.* + +/** + * This tests mainly checks if linking to relocated methods with no package works + */ +class MultiModule1IntegrationTest(override val versions: BuildVersions) : AbstractGradleIntegrationTest() { + companion object { + @get:JvmStatic + @get:Parameterized.Parameters(name = "{0}") + val versions = BuildVersions.permutations( + gradleVersions = listOf("6.6", "6.1.1"), + kotlinVersions = listOf("1.4.0") + ) + } + + @BeforeTest + fun prepareProjectFiles() { + val templateProjectDir = File("projects", "it-multimodule-1") + templateProjectDir.listFiles().orEmpty() + .filter { it.isFile } + .forEach { topLevelFile -> topLevelFile.copyTo(File(projectDir, topLevelFile.name)) } + File(templateProjectDir, "first").copyRecursively(File(projectDir, "first")) + File(templateProjectDir, "second").copyRecursively(File(projectDir, "second")) + } + + @Test + fun execute() { + val result = createGradleRunner( + ":second:dokkaHtml", + "-i", "-s" + ).buildRelaxed() + + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":second:dokkaHtml")).outcome) + + val outputDir = File(projectDir, "second/build/dokka/html") + assertTrue(outputDir.isDirectory, "Missing dokka output directory") + + assertTrue( + outputDir.allHtmlFiles().any(), + "Expected at least one html file being generated" + ) + + outputDir.allHtmlFiles().forEach { file -> + assertContainsNoErrorClass(file) + assertNoUnresolvedLinks(file) + assertNoHrefToMissingLocalFileOrDirectory(file) + assertNoEmptyLinks(file) + assertNoEmptySpans(file) + } + } +} |