diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2021-06-22 15:17:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-22 15:17:55 +0200 |
commit | 9e15f07aefe6ea1f366466c6721b92e77e3f1b41 (patch) | |
tree | 60ab664edbab02f3c128c1158a9490d06d44f66e /integration-tests/cli/src/integrationTest | |
parent | 8d6536d3a3d0dcd80a2e6b77b047524e15533f0b (diff) | |
download | dokka-9e15f07aefe6ea1f366466c6721b92e77e3f1b41.tar.gz dokka-9e15f07aefe6ea1f366466c6721b92e77e3f1b41.tar.bz2 dokka-9e15f07aefe6ea1f366466c6721b92e77e3f1b41.zip |
Logging in CLI (#1976)
Diffstat (limited to 'integration-tests/cli/src/integrationTest')
-rw-r--r-- | integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt index 05ef667a..8935f8f5 100644 --- a/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt +++ b/integration-tests/cli/src/integrationTest/kotlin/org/jetbrains/dokka/it/cli/CliIntegrationTest.kt @@ -155,6 +155,7 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { val process = ProcessBuilder( "java", "-jar", cliJarFile.path, "-outputDir", dokkaOutputDir.path, + "-loggingLevel", "DEBUG", "-pluginsClasspath", basePluginJarFile.path, "-sourceSet", buildString { @@ -166,6 +167,7 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { val result = process.awaitProcessResult() assertEquals(0, result.exitCode, "Expected exitCode 0 (Success)") + assertTrue(result.output.contains("Loaded plugins: "), "Expected output to not contain info logs") assertTrue(dokkaOutputDir.isDirectory, "Missing dokka output directory") @@ -181,4 +183,26 @@ class CliIntegrationTest : AbstractCliIntegrationTest() { val navigationHtml = File(dokkaOutputDir, "navigation.html") assertTrue(navigationHtml.isFile, "Missing navigation.html") } + + @Test + fun `logging level should be respected`(){ + val dokkaOutputDir = File(projectDir, "output") + assertTrue(dokkaOutputDir.mkdirs()) + val process = ProcessBuilder( + "java", "-jar", cliJarFile.path, + "-outputDir", dokkaOutputDir.path, + "-loggingLevel", "WARN", + "-pluginsClasspath", basePluginJarFile.path, + "-sourceSet", + buildString { + append(" -src ${File(projectDir, "src").path}") + } + ) + .redirectErrorStream(true) + .start() + + val result = process.awaitProcessResult() + assertEquals(0, result.exitCode, "Expected exitCode 0 (Success)") + assertFalse(result.output.contains("Loaded plugins: "), "Expected output to not contain info logs") + } } |