diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2021-01-21 00:34:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-21 00:34:43 +0100 |
commit | fdf8a298f586d7e334c312346b70b59c64c8d037 (patch) | |
tree | d9e92e920c24f442df6339e19b27225d7d01d21b /plugins/all-modules-page/src/test/kotlin | |
parent | 1f592a7ec2786e0a0b77d224d1414ef3042caae4 (diff) | |
download | dokka-fdf8a298f586d7e334c312346b70b59c64c8d037.tar.gz dokka-fdf8a298f586d7e334c312346b70b59c64c8d037.tar.bz2 dokka-fdf8a298f586d7e334c312346b70b59c64c8d037.zip |
Empty modules filtering (#1699)
Diffstat (limited to 'plugins/all-modules-page/src/test/kotlin')
3 files changed, 18 insertions, 6 deletions
diff --git a/plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt b/plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt index c8542dfe..9213c90b 100644 --- a/plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt +++ b/plugins/all-modules-page/src/test/kotlin/MultiModuleDokkaTestGenerator.kt @@ -34,7 +34,10 @@ class MultiModuleDokkaTestGenerator( val generation = context.single(CoreExtensions.generation) as AllModulesPageGeneration - val allModulesPage = generation.createAllModulesPage() + val generationContext = generation.processSubmodules() + submoduleProcessingStage(context) + + val allModulesPage = generation.createAllModulesPage(generationContext) allModulesPageCreationStage(allModulesPage) val transformedPages = generation.transformAllModulesPage(allModulesPage) @@ -43,8 +46,11 @@ class MultiModuleDokkaTestGenerator( generation.render(transformedPages) renderingStage(transformedPages, context) - generation.processSubmodules() - submoduleProcessingStage(context) + generation.processMultiModule(transformedPages) + processMultiModule(transformedPages) + + generation.finishProcessingSubmodules() + finishProcessingSubmodules(context) } } @@ -55,6 +61,8 @@ open class MultiModuleTestMethods( open val pagesTransformationStage: (RootPageNode) -> Unit, open val renderingStage: (RootPageNode, DokkaContext) -> Unit, open val submoduleProcessingStage: (DokkaContext) -> Unit, + open val processMultiModule: (RootPageNode) -> Unit, + open val finishProcessingSubmodules: (DokkaContext) -> Unit, ) : TestMethods class MultiModuleTestBuilder : TestBuilder<MultiModuleTestMethods>() { @@ -63,6 +71,8 @@ class MultiModuleTestBuilder : TestBuilder<MultiModuleTestMethods>() { var pagesTransformationStage: (RootPageNode) -> Unit = {} var renderingStage: (RootPageNode, DokkaContext) -> Unit = { _, _ -> } var submoduleProcessingStage: (DokkaContext) -> Unit = {} + var processMultiModule: (RootPageNode) -> Unit = {} + var finishProcessingSubmodules: (DokkaContext) -> Unit = {} override fun build() = MultiModuleTestMethods( pluginsSetupStage, @@ -70,6 +80,8 @@ class MultiModuleTestBuilder : TestBuilder<MultiModuleTestMethods>() { pagesTransformationStage, renderingStage, submoduleProcessingStage, + processMultiModule, + finishProcessingSubmodules ) } diff --git a/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkCommandResolutionTest.kt b/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkCommandResolutionTest.kt index cbf254a0..2637714f 100644 --- a/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkCommandResolutionTest.kt +++ b/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkCommandResolutionTest.kt @@ -60,7 +60,7 @@ class ResolveLinkCommandResolutionTest : MultiModuleAbstractTest() { val configuration = configuration() testFromData(configuration, preserveOutputLocation = true) { - submoduleProcessingStage = { + finishProcessingSubmodules = { assertHtmlEqualsIgnoringWhitespace(expected, contentFile.readText()) } } @@ -89,7 +89,7 @@ class ResolveLinkCommandResolutionTest : MultiModuleAbstractTest() { val configuration = configuration() testFromData(configuration, preserveOutputLocation = true) { - submoduleProcessingStage = { + finishProcessingSubmodules = { assertHtmlEqualsIgnoringWhitespace(expected, contentFile.readText()) } } diff --git a/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkGfmCommandResolutionTest.kt b/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkGfmCommandResolutionTest.kt index 75576727..185a179d 100644 --- a/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkGfmCommandResolutionTest.kt +++ b/plugins/all-modules-page/src/test/kotlin/templates/ResolveLinkGfmCommandResolutionTest.kt @@ -55,7 +55,7 @@ class ResolveLinkGfmCommandResolutionTest : MultiModuleAbstractTest() { val configuration = configuration() testFromData(configuration, pluginOverrides = listOf(GfmTemplateProcessingPlugin(), GfmPlugin()), preserveOutputLocation = true) { - submoduleProcessingStage = { + finishProcessingSubmodules = { assertEquals(expected, content.readText().trim()) } } |