aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2017-02-23 19:08:31 +0100
committerDmitry Jemerov <yole@jetbrains.com>2017-02-23 19:08:31 +0100
commitff8fdb0bbc4069773424400acfdce36a4e3d6d6a (patch)
treeced42fb0bc0690191fc8836a47e3a4e19765e563 /core/src/test/kotlin
parent66757b43bb48d52e4fb92d38e9a893ab40d1d63e (diff)
downloaddokka-ff8fdb0bbc4069773424400acfdce36a4e3d6d6a.tar.gz
dokka-ff8fdb0bbc4069773424400acfdce36a4e3d6d6a.tar.bz2
dokka-ff8fdb0bbc4069773424400acfdce36a4e3d6d6a.zip
Resolve link and generate alltypes only once, not after every platform
Diffstat (limited to 'core/src/test/kotlin')
-rw-r--r--core/src/test/kotlin/TestAPI.kt20
-rw-r--r--core/src/test/kotlin/format/MarkdownFormatTest.kt5
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
}