diff options
Diffstat (limited to 'plugins/javadoc')
7 files changed, 47 insertions, 12 deletions
diff --git a/plugins/javadoc/build.gradle.kts b/plugins/javadoc/build.gradle.kts index 2a04366b..ea882bb4 100644 --- a/plugins/javadoc/build.gradle.kts +++ b/plugins/javadoc/build.gradle.kts @@ -7,6 +7,7 @@ import org.jetbrains.registerDokkaArtifactPublication plugins { id("org.jetbrains.conventions.kotlin-jvm") id("org.jetbrains.conventions.maven-publish") + id("org.jetbrains.conventions.base-unit-test") } dependencies { @@ -22,7 +23,11 @@ dependencies { implementation(libs.kotlinx.coroutines.core) testImplementation(kotlin("test")) - testImplementation(projects.plugins.base.baseTestUtils) + symbolsTestConfiguration(project(path = ":subprojects:analysis-kotlin-symbols", configuration = "shadow")) + descriptorsTestConfiguration(project(path = ":subprojects:analysis-kotlin-descriptors", configuration = "shadow")) + testImplementation(projects.plugins.base.baseTestUtils) { + exclude(module = "analysis-kotlin-descriptors") + } testImplementation(projects.core.testApi) testImplementation(libs.jsoup) } diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/AbstractJavadocTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/AbstractJavadocTemplateMapTest.kt index 070f1834..60265e33 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/AbstractJavadocTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/AbstractJavadocTemplateMapTest.kt @@ -28,6 +28,7 @@ internal abstract class AbstractJavadocTemplateMapTest : BaseAbstractTest() { DokkaConfiguration.ExternalDocumentationLink.jdk(8), DokkaConfiguration.ExternalDocumentationLink.kotlinStdlib() ) + classpath = listOfNotNull(jvmStdlibPath) } } } diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAccessorNamingTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAccessorNamingTest.kt index 3f7e1610..95ce4d27 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAccessorNamingTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAccessorNamingTest.kt @@ -8,6 +8,7 @@ import org.jsoup.Jsoup import utils.TestOutputWriterPlugin import kotlin.test.Test import kotlin.test.assertEquals +import kotlin.test.assertTrue internal class JavadocAccessorNamingTest : AbstractJavadocTemplateMapTest() { @@ -16,6 +17,7 @@ internal class JavadocAccessorNamingTest : AbstractJavadocTemplateMapTest() { sourceSets { sourceSet { sourceRoots = listOf("src/main/kotlin") + classpath = listOfNotNull(jvmStdlibPath) } } } @@ -54,13 +56,20 @@ internal class JavadocAccessorNamingTest : AbstractJavadocTemplateMapTest() { .select("code") .map { it.text() } .toSet() - - assertEquals(setOf( - "getIssuesFetched()", - "setIssuesFetched(Integer issuesFetched)", - "isFoo()", - "setFoo(String isFoo)", - ), props) + // In K2 name of accessors parameter is `value` + assertTrue( + setOf( + "getIssuesFetched()", + "setIssuesFetched(Integer issuesFetched)", + "isFoo()", + "setFoo(String isFoo)", + ) == props || setOf( + "getIssuesFetched()", + "setIssuesFetched(Integer value)", + "isFoo()", + "setFoo(String value)", + ) == props + ) val descriptionLinks = html .select("div.description") diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAllClassesTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAllClassesTemplateMapTest.kt index a399f523..8d7ff1ea 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAllClassesTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocAllClassesTemplateMapTest.kt @@ -8,11 +8,13 @@ import org.jetbrains.dokka.javadoc.pages.AllClassesPage import org.jetbrains.dokka.javadoc.pages.LinkJavadocListEntry import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.ContentKind +import org.junit.jupiter.api.Tag import kotlin.test.Test import kotlin.test.assertEquals internal class JavadocAllClassesTemplateMapTest : AbstractJavadocTemplateMapTest() { @Test + @Tag("onlyDescriptors") // https://github.com/Kotlin/dokka/issues/3250 fun `two classes from different packages`() { dualTestTemplateMapInline( """ diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt index ec36d0e3..ba8f73cf 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocIndexTest.kt @@ -7,6 +7,7 @@ package org.jetbrains.dokka.javadoc import org.jetbrains.dokka.javadoc.pages.IndexPage import org.jetbrains.dokka.javadoc.renderer.TemplateMap import org.jetbrains.dokka.links.DRI +import org.junit.jupiter.api.Tag import kotlin.test.Test import kotlin.test.assertEquals import kotlin.test.assertNotNull @@ -76,7 +77,21 @@ internal class JavadocIndexTest : AbstractJavadocTemplateMapTest() { AnnotationTarget.ANNOTATION_CLASS::class.java.methods.any { it.name == "describeConstable" } testIndexPages(commonTestQuery) { indexPages -> - assertEquals(if (hasAdditionalFunction()) 33 else 32, indexPages.sumBy { it.elements.size }) + assertEquals("A-index: a, A\n" + + "B-index: b\n" + + "C-index: c, ClassA, ClassB, ClassC, ClassC.InnerClass, ClassCEnum, compareTo\n" + + "D-index: d, D\n" + + "E-index: e, E, equals, equals\n" + + "F-index: f\n" + + "G-index: g, getDeclaringClass, getEntries, getName, getOrdinal\n" + + "H-index: h, hashCode, hashCode\n" + + "J-index: j\n" + + "K-index: k\n" + + "P-index: package0, package1\n" + + "T-index: toString, toString\n" + + "V-index: valueOf, values", + indexPages.joinToString("\n") { it.title + ": " + it.elements.joinToString { it.getId() } }) + assertEquals(if (hasAdditionalFunction()) 34 else 33, indexPages.sumBy { it.elements.size }) } } diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt index 60de0e3d..bef81372 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/location/JavadocLocationTest.kt @@ -247,6 +247,7 @@ class JavadocLocationTest : BaseAbstractTest() { DokkaConfiguration.ExternalDocumentationLink.kotlinStdlib() ) analysisPlatform = "jvm" + classpath = listOfNotNull(jvmStdlibPath) } } } diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/validity/MultiplatformConfiguredCheckerTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/validity/MultiplatformConfiguredCheckerTest.kt index 0bd6c4d5..cea32026 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/validity/MultiplatformConfiguredCheckerTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/validity/MultiplatformConfiguredCheckerTest.kt @@ -18,7 +18,7 @@ class MultiplatformConfiguredCheckerTest : BaseAbstractTest() { format = "javadoc" sourceSets { sourceSet { - sourceRoots = listOf("src") + sourceRoots = listOf("src/jvm") analysisPlatform = "jvm" externalDocumentationLinks = listOf( ExternalDocumentationLink("https://docs.oracle.com/javase/8/docs/api/"), @@ -26,7 +26,7 @@ class MultiplatformConfiguredCheckerTest : BaseAbstractTest() { ) } sourceSet { - sourceRoots = listOf("src") + sourceRoots = listOf("src/js") analysisPlatform = "js" externalDocumentationLinks = listOf( ExternalDocumentationLink("https://docs.oracle.com/javase/8/docs/api/"), @@ -54,7 +54,9 @@ class MultiplatformConfiguredCheckerTest : BaseAbstractTest() { fun `mpp config should fail for javadoc`() { testInline( """ - |/src/main/kotlin/example/Test.kt + |/src/jvm/kotlin/example/Test.kt + |class Test + |/src/js/kotlin/example/Test.kt |class Test """.trimMargin(), mppConfig ) { |