aboutsummaryrefslogtreecommitdiff
path: root/core/src/test/kotlin/TestAPI.kt
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-02-22 14:31:12 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-02-22 14:31:12 +0300
commitf37d9c3bdd91c5af683eb7eaaf242d7af3d6fcf1 (patch)
treeb9039596c118469ef4f9151eee195a50c0cac4f1 /core/src/test/kotlin/TestAPI.kt
parent79a7a136bdc3a59d7bb3aebb51e565b58e2b789c (diff)
parent3eb23215edcd1cf92966f8d39afe754fef0c7a19 (diff)
downloaddokka-f37d9c3bdd91c5af683eb7eaaf242d7af3d6fcf1.tar.gz
dokka-f37d9c3bdd91c5af683eb7eaaf242d7af3d6fcf1.tar.bz2
dokka-f37d9c3bdd91c5af683eb7eaaf242d7af3d6fcf1.zip
Merge branch 'dev'
Diffstat (limited to 'core/src/test/kotlin/TestAPI.kt')
-rw-r--r--core/src/test/kotlin/TestAPI.kt35
1 files changed, 30 insertions, 5 deletions
diff --git a/core/src/test/kotlin/TestAPI.kt b/core/src/test/kotlin/TestAPI.kt
index a1a98ec7..ff8a5260 100644
--- a/core/src/test/kotlin/TestAPI.kt
+++ b/core/src/test/kotlin/TestAPI.kt
@@ -24,17 +24,24 @@ fun verifyModel(vararg roots: ContentRoot,
withKotlinRuntime: Boolean = false,
format: String = "html",
includeNonPublic: Boolean = true,
+ perPackageOptions: List<DokkaConfiguration.PackageOptions> = emptyList(),
verifier: (DocumentationModule) -> Unit) {
val documentation = DocumentationModule("test")
- val options = DocumentationOptions("", format,
+ val options = DocumentationOptions(
+ "",
+ format,
includeNonPublic = includeNonPublic,
skipEmptyPackages = false,
includeRootPackage = true,
- sourceLinks = listOf<SourceLinkDefinition>(),
+ sourceLinks = listOf(),
+ perPackageOptions = perPackageOptions,
generateIndexPages = false,
noStdlibLink = true,
- cacheRoot = "default")
+ cacheRoot = "default",
+ languageVersion = null,
+ apiVersion = null
+ )
appendDocumentation(documentation, *roots,
withJdk = withJdk,
@@ -86,6 +93,8 @@ fun appendDocumentation(documentation: DocumentationModule,
addClasspath(File(kotlinStrictfpRoot))
}
addRoots(roots.toList())
+
+ loadLanguageVersionSettings(options.languageVersion, options.apiVersion)
}
val defaultPlatformsProvider = object : DefaultPlatformsProvider {
override fun getDefaultPlatforms(descriptor: DeclarationDescriptor) = defaultPlatforms
@@ -151,8 +160,15 @@ fun verifyOutput(roots: Array<ContentRoot>,
withJdk: Boolean = false,
withKotlinRuntime: Boolean = false,
format: String = "html",
+ includeNonPublic: Boolean = true,
outputGenerator: (DocumentationModule, StringBuilder) -> Unit) {
- verifyModel(*roots, withJdk = withJdk, withKotlinRuntime = withKotlinRuntime, format = format) {
+ verifyModel(
+ *roots,
+ withJdk = withJdk,
+ withKotlinRuntime = withKotlinRuntime,
+ format = format,
+ includeNonPublic = includeNonPublic
+ ) {
verifyModelOutput(it, outputExtension, roots.first().path, outputGenerator)
}
}
@@ -173,8 +189,17 @@ fun verifyOutput(path: String,
withJdk: Boolean = false,
withKotlinRuntime: Boolean = false,
format: String = "html",
+ includeNonPublic: Boolean = true,
outputGenerator: (DocumentationModule, StringBuilder) -> Unit) {
- verifyOutput(arrayOf(contentRootFromPath(path)), outputExtension, withJdk, withKotlinRuntime, format, outputGenerator)
+ verifyOutput(
+ arrayOf(contentRootFromPath(path)),
+ outputExtension,
+ withJdk,
+ withKotlinRuntime,
+ format,
+ includeNonPublic,
+ outputGenerator
+ )
}
fun verifyJavaOutput(path: String,