diff options
Diffstat (limited to 'core/src/test')
-rw-r--r-- | core/src/test/kotlin/TestAPI.kt | 20 | ||||
-rw-r--r-- | core/src/test/kotlin/format/MarkdownFormatTest.kt | 5 |
2 files changed, 14 insertions, 11 deletions
diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt index 86111e76..be484279 100644 --- a/core/src/test/kotlin/TestAPI.kt +++ b/core/src/test/kotlin/TestAPI.kt @@ -23,11 +23,19 @@ fun verifyModel(vararg roots: ContentRoot, includeNonPublic: Boolean = true, verifier: (DocumentationModule) -> Unit) { val documentation = DocumentationModule("test") + + val options = DocumentationOptions("", format, + includeNonPublic = includeNonPublic, + skipEmptyPackages = false, + sourceLinks = listOf<SourceLinkDefinition>(), + generateIndexPages = false) + appendDocumentation(documentation, *roots, withJdk = withJdk, withKotlinRuntime = withKotlinRuntime, - format = format, - includeNonPublic = includeNonPublic) + options = options) + documentation.prepareForGeneration(options) + verifier(documentation) } @@ -35,8 +43,7 @@ fun appendDocumentation(documentation: DocumentationModule, vararg roots: ContentRoot, withJdk: Boolean = false, withKotlinRuntime: Boolean = false, - format: String = "html", - includeNonPublic: Boolean = true, + options: DocumentationOptions, defaultPlatforms: List<String> = emptyList()) { val messageCollector = object : MessageCollector { override fun clear() { @@ -76,11 +83,6 @@ fun appendDocumentation(documentation: DocumentationModule, } addRoots(roots.toList()) } - val options = DocumentationOptions("", format, - includeNonPublic = includeNonPublic, - skipEmptyPackages = false, - sourceLinks = listOf<SourceLinkDefinition>(), - generateIndexPages = false) val injector = Guice.createInjector( DokkaAnalysisModule(environment, options, defaultPlatforms, documentation.nodeRefGraph, DokkaConsoleLogger)) buildDocumentationModule(injector, documentation) diff --git a/core/src/test/kotlin/format/MarkdownFormatTest.kt b/core/src/test/kotlin/format/MarkdownFormatTest.kt index c09f2624..dc24c8d8 100644 --- a/core/src/test/kotlin/format/MarkdownFormatTest.kt +++ b/core/src/test/kotlin/format/MarkdownFormatTest.kt @@ -267,8 +267,9 @@ class MarkdownFormatTest { private fun buildMultiplePlatforms(path: String): DocumentationModule { val module = DocumentationModule("test") - appendDocumentation(module, contentRootFromPath("testdata/format/$path/jvm.kt"), defaultPlatforms = listOf("JVM")) - appendDocumentation(module, contentRootFromPath("testdata/format/$path/js.kt"), defaultPlatforms = listOf("JS")) + val options = DocumentationOptions("", "html", generateIndexPages = false) + appendDocumentation(module, contentRootFromPath("testdata/format/$path/jvm.kt"), defaultPlatforms = listOf("JVM"), options = options) + appendDocumentation(module, contentRootFromPath("testdata/format/$path/js.kt"), defaultPlatforms = listOf("JS"), options = options) return module } |