Skip to content

Commit

Permalink
Register Kotlin stdlib classpath in every unit test (#3183)
Browse files Browse the repository at this point in the history
Due to the recent changes in how Analysis API handles builtins, the update to the fresh version of Analysis API requires registering Kotlin stdlib in every testsuite.
  • Loading branch information
vmishenev committed Oct 5, 2023
1 parent 38e09dd commit 62d1143
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 8 deletions.
2 changes: 1 addition & 1 deletion plugins/base/src/test/kotlin/content/HighlightingTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class HighlightingTest : BaseAbstractTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOf(commonStdlibPath!!)
classpath = listOf(commonStdlibPath!!, jvmStdlibPath!!)
externalDocumentationLinks = listOf(stdlibExternalDocumentationLink)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class KotlinDeprecatedTest : BaseAbstractTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOfNotNull(jvmStdlibPath)
analysisPlatform = "jvm"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class SinceKotlinTest : AbstractRenderingTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOfNotNull(jvmStdlibPath)
analysisPlatform = "jvm"
}
}
Expand Down Expand Up @@ -185,6 +186,7 @@ class SinceKotlinTest : AbstractRenderingTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOfNotNull(jvmStdlibPath)
analysisPlatform = "jvm"
}
sourceSet {
Expand All @@ -193,10 +195,12 @@ class SinceKotlinTest : AbstractRenderingTest() {
}
sourceSet {
sourceRoots = listOf("src/")
classpath = listOfNotNull(commonStdlibPath)
analysisPlatform = "common"
}
sourceSet {
sourceRoots = listOf("src/")
classpath = listOfNotNull(jsStdlibPath)
analysisPlatform = "js"
}
sourceSet {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ import org.jetbrains.dokka.PluginConfigurationImpl
import org.jetbrains.dokka.base.DokkaBase
import org.jetbrains.dokka.base.testApi.testRunner.BaseAbstractTest
import org.jetbrains.dokka.model.DisplaySourceSet
import utils.ParamAttributes
import utils.bareSignature
import utils.findTestType
import utils.OnlyDescriptors
import utils.*
import kotlin.test.Test
import kotlin.test.assertEquals

Expand All @@ -22,6 +19,7 @@ class ContentForExceptions : BaseAbstractTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOfNotNull(jvmStdlibPath)
analysisPlatform = "jvm"
}
}
Expand All @@ -35,13 +33,15 @@ class ContentForExceptions : BaseAbstractTest() {
displayName = "common"
analysisPlatform = "common"
sourceRoots = listOf("src/commonMain/kotlin/pageMerger/Test.kt")
classpath = listOfNotNull(commonStdlibPath)
}
sourceSet {
name = "jvm"
displayName = "jvm"
analysisPlatform = "jvm"
dependentSourceSets = setOf(common.value.sourceSetID)
sourceRoots = listOf("src/jvmMain/kotlin/pageMerger/Test.kt")
classpath = listOfNotNull(jvmStdlibPath)
}
sourceSet {
name = "linuxX64"
Expand Down Expand Up @@ -339,6 +339,7 @@ class ContentForExceptions : BaseAbstractTest() {
}
}

@OnlyDescriptorsMPP("Return type for native `function` should be null rather than kotlin/Unit")
@Test
fun `throws in merged functions`() {
testInline(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class ContentForParamsTest : BaseAbstractTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOfNotNull(jvmStdlibPath)
analysisPlatform = "jvm"
}
}
Expand Down Expand Up @@ -531,7 +532,7 @@ class ContentForParamsTest : BaseAbstractTest() {
link {
check {
assertEquals(
"java.lang/RuntimeException///PointingToDeclaration/",
"kotlin/RuntimeException///PointingToDeclaration/",
(this as ContentDRILink).address.toString()
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOfNotNull(jvmStdlibPath)
analysisPlatform = "jvm"
}
}
Expand Down Expand Up @@ -217,6 +218,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() {
}
}

@OnlyDescriptors("issue #3179")
@Test
fun `undocumented seealso with reference to property for class`() {
testInline(
Expand Down Expand Up @@ -310,6 +312,7 @@ class ContentForSeeAlsoTest : BaseAbstractTest() {
}
}

@OnlyDescriptors("issue #3179")
@Test
fun `documented seealso with reference to property for class`() {
testInline(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class TypealiasTest : BaseAbstractTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOf(commonStdlibPath!!)
classpath = listOf(commonStdlibPath!!, jvmStdlibPath!!)
externalDocumentationLinks = listOf(stdlibExternalDocumentationLink)
}
}
Expand Down
1 change: 1 addition & 0 deletions plugins/base/src/test/kotlin/enums/KotlinEnumsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ class KotlinEnumsTest : BaseAbstractTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOfNotNull(jvmStdlibPath)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class DeprecationFilterTest : BaseAbstractTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/main/kotlin/basic/Test.kt")
classpath = listOfNotNull(jvmStdlibPath)
skipDeprecated = false
perPackageOptions = mutableListOf(
PackageOptionsImpl(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,7 @@ class VisibilityFilterTest : BaseAbstractTest() {
sourceSet {
includeNonPublic = true
sourceRoots = listOf("src/main/kotlin/basic/Test.kt")
classpath = listOfNotNull(jvmStdlibPath)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class FunctionalTypeConstructorsSignatureTest : BaseAbstractTest() {
sourceSets {
sourceSet {
sourceRoots = listOf("src/")
classpath = listOf(commonStdlibPath!!)
classpath = listOf(commonStdlibPath!!, jvmStdlibPath!!)
externalDocumentationLinks = listOf(
stdlibExternalDocumentationLink,
DokkaConfiguration.ExternalDocumentationLink.Companion.jdk(8)
Expand Down

0 comments on commit 62d1143

Please sign in to comment.