aboutsummaryrefslogtreecommitdiff
path: root/runners/cli/src/test/kotlin/org/jetbrains/dokka
diff options
context:
space:
mode:
authorIgnat Beresnev <ignat.beresnev@jetbrains.com>2022-04-29 15:03:08 +0300
committerGitHub <noreply@github.com>2022-04-29 15:03:08 +0300
commit8c218ff4dd5f970233c43845c19299fc74256389 (patch)
treeb6818183ce8faa2c58d6571ca1c86aa28d4f0431 /runners/cli/src/test/kotlin/org/jetbrains/dokka
parent84aacad29982240ae367b21e9d283d38dab672ae (diff)
downloaddokka-8c218ff4dd5f970233c43845c19299fc74256389.tar.gz
dokka-8c218ff4dd5f970233c43845c19299fc74256389.tar.bz2
dokka-8c218ff4dd5f970233c43845c19299fc74256389.zip
Enable warnings as errors and fix all warnings (#2451)
* Enable warnings as errors and fix all warnings * Enable skip-metadata-version-check compiler setting
Diffstat (limited to 'runners/cli/src/test/kotlin/org/jetbrains/dokka')
-rw-r--r--runners/cli/src/test/kotlin/org/jetbrains/dokka/CliTest.kt43
1 files changed, 43 insertions, 0 deletions
diff --git a/runners/cli/src/test/kotlin/org/jetbrains/dokka/CliTest.kt b/runners/cli/src/test/kotlin/org/jetbrains/dokka/CliTest.kt
new file mode 100644
index 00000000..557fe36b
--- /dev/null
+++ b/runners/cli/src/test/kotlin/org/jetbrains/dokka/CliTest.kt
@@ -0,0 +1,43 @@
+package org.jetbrains.dokka
+
+import org.junit.Test
+import java.lang.IllegalStateException
+import java.nio.file.Paths
+import kotlin.test.assertEquals
+import kotlin.test.assertTrue
+
+class CliIntegrationTest {
+
+ @Test
+ fun `should apply global settings to all source sets`() {
+ val jsonPath = Paths.get(javaClass.getResource("/my-file.json")?.toURI() ?: throw IllegalStateException("No JSON found!")).toFile().toString()
+ val globalArguments = GlobalArguments(arrayOf(jsonPath))
+
+ val configuration = initializeConfiguration(globalArguments)
+
+ configuration.sourceSets.forEach {
+ assertTrue(it.perPackageOptions.isNotEmpty())
+ assertTrue(it.sourceLinks.isNotEmpty())
+ assertTrue(it.externalDocumentationLinks.isNotEmpty())
+
+ assertTrue(it.externalDocumentationLinks.any { it.url.toString() == "https://docs.oracle.com/javase/8/docs/api/" })
+ assertEquals(it.sourceLinks.single().localDirectory, "/home/Vadim.Mishenev/dokka/examples/cli/src/main/kotlin")
+ assertEquals(it.perPackageOptions.single().matchingRegex, "my-custom-regex")
+ }
+
+ }
+
+ @Test
+ fun `should not fail when no sourceset options are specified`() {
+ val jsonPath = Paths.get(javaClass.getResource("/my-file-no-sourceset-options.json")?.toURI() ?: throw IllegalStateException("No JSON found!")).toFile().toString()
+ val globalArguments = GlobalArguments(arrayOf(jsonPath))
+
+ val configuration = initializeConfiguration(globalArguments)
+
+ configuration.sourceSets.forEach {
+ assertTrue(it.perPackageOptions.isEmpty())
+ assertTrue(it.sourceLinks.isEmpty())
+ assertTrue(it.externalDocumentationLinks.size == 2) // there are default values, java and kotlin stdlibs
+ }
+ }
+}