From a1f8efc30b4421ce371b02b747bbeac24fafd7ba Mon Sep 17 00:00:00 2001 From: Andrzej Ratajczak Date: Thu, 25 Jun 2020 14:22:51 +0200 Subject: Changed way of merging documentables to avoid exception on merging documentables of different types. Minor javadoc fixes. Changed constructor names. Add handling same name pages clash for different platforms --- .../kotlin/signatures/DivergentSignatureTest.kt | 135 ++++++--------------- 1 file changed, 37 insertions(+), 98 deletions(-) (limited to 'plugins/base/src/test/kotlin/signatures') diff --git a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt index 2e8e0ef3..975373b6 100644 --- a/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt +++ b/plugins/base/src/test/kotlin/signatures/DivergentSignatureTest.kt @@ -10,40 +10,43 @@ import utils.TestOutputWriterPlugin class DivergentSignatureTest : AbstractCoreTest() { - @Test - fun `group { common + jvm + js }`() { - - val testDataDir = getTestDataDir("multiplatform/basicMultiplatformTest").toAbsolutePath() - - val configuration = dokkaConfiguration { - moduleName = "example" - sourceSets { - sourceSet { - displayName = "js" - name = "js" - analysisPlatform = "js" - sourceRoots = listOf("jsMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "jvm" - name = "jvm" - analysisPlatform = "jvm" - sourceRoots = listOf("jvmMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "common" - name = "common" - analysisPlatform = "common" - sourceRoots = listOf("commonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } + val testDataDir = getTestDataDir("multiplatform/basicMultiplatformTest").toAbsolutePath() + + val configuration = dokkaConfiguration { + moduleName = "example" + sourceSets { + val common = sourceSet { + name = "common" + displayName = "common" + analysisPlatform = "common" + sourceRoots = listOf(Paths.get("$testDataDir/commonMain/kotlin").toString()) + } + val jvmAndJsSecondCommonMain = sourceSet { + name = "jvmAndJsSecondCommonMain" + displayName = "jvmAndJsSecondCommonMain" + analysisPlatform = "common" + dependentSourceSets = setOf(common.value.sourceSetID) + sourceRoots = listOf(Paths.get("$testDataDir/jvmAndJsSecondCommonMain/kotlin").toString()) + } + val js = sourceSet { + name = "js" + displayName = "js" + analysisPlatform = "js" + dependentSourceSets = setOf(common.value.sourceSetID, jvmAndJsSecondCommonMain.value.sourceSetID) + sourceRoots = listOf(Paths.get("$testDataDir/jsMain/kotlin").toString()) + } + val jvm = sourceSet { + name = "jvm" + displayName = "jvm" + analysisPlatform = "jvm" + dependentSourceSets = setOf(common.value.sourceSetID, jvmAndJsSecondCommonMain.value.sourceSetID) + sourceRoots = listOf(Paths.get("$testDataDir/jvmMain/kotlin").toString()) } } + } + + @Test + fun `group { common + jvm + js }`() { val writerPlugin = TestOutputWriterPlugin() @@ -55,7 +58,7 @@ class DivergentSignatureTest : AbstractCoreTest() { val content = writerPlugin.renderedContent("example/example/-clock/get-time.html") assert(content.count() == 1) - assert(content.select("[data-filterable-current=example/js example/jvm example/common]").single().brief == "") + assert(content.select("[data-filterable-current=example/common example/jvm example/js]").single().brief == "common") } } } @@ -63,38 +66,6 @@ class DivergentSignatureTest : AbstractCoreTest() { @Test fun `group { common + jvm }, group { js }`() { - val testDataDir = getTestDataDir("multiplatform/basicMultiplatformTest").toAbsolutePath() - - val configuration = dokkaConfiguration { - moduleName = "example" - sourceSets { - sourceSet { - displayName = "js" - name = "js" - analysisPlatform = "js" - sourceRoots = listOf("jsMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "jvm" - name = "jvm" - analysisPlatform = "jvm" - sourceRoots = listOf("jvmMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "common" - name = "common" - analysisPlatform = "common" - sourceRoots = listOf("commonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - } - } - val writerPlugin = TestOutputWriterPlugin() testFromData( @@ -104,7 +75,7 @@ class DivergentSignatureTest : AbstractCoreTest() { renderingStage = { _, _ -> val content = writerPlugin.renderedContent("example/example/-clock/get-times-in-millis.html") assert(content.count() == 2) - assert(content.select("[data-filterable-current=example/jvm example/common]").single().brief == "Time in minis") + assert(content.select("[data-filterable-current=example/common example/jvm]").single().brief == "Time in minis common") assert(content.select("[data-filterable-current=example/js]").single().brief == "JS implementation of getTimeInMillis js" ) } } @@ -113,38 +84,6 @@ class DivergentSignatureTest : AbstractCoreTest() { @Test fun `group { js }, group { jvm }, group { js }`() { - val testDataDir = getTestDataDir("multiplatform/basicMultiplatformTest").toAbsolutePath() - - val configuration = dokkaConfiguration { - moduleName = "example" - sourceSets { - sourceSet { - displayName = "js" - name = "js" - analysisPlatform = "js" - sourceRoots = listOf("jsMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "jvm" - name = "jvm" - analysisPlatform = "jvm" - sourceRoots = listOf("jvmMain", "commonMain", "jvmAndJsSecondCommonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - sourceSet { - displayName = "common" - name = "common" - analysisPlatform = "common" - sourceRoots = listOf("commonMain").map { - Paths.get("$testDataDir/$it/kotlin").toString() - } - } - } - } - val writerPlugin = TestOutputWriterPlugin() testFromData( -- cgit