[Test] Add ability to freely transform module structure which was parsed from directive
Service ModuleStructureExtractor may break readabilty of test so it should be used very carefully Originally it is created for box inline test where we have different runners on same testdata where one runner assumes that all files in test in same module and other that they in different ones
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.test
|
||||
|
||||
/**
|
||||
* This annotation used for marking low-level services of test infrastructure which
|
||||
* normally should not be used. Please think twice before using something
|
||||
* marked with this annotation
|
||||
*/
|
||||
@RequiresOptIn
|
||||
annotation class TestInfrastructureInternals
|
||||
+4
-2
@@ -5,11 +5,13 @@
|
||||
|
||||
package org.jetbrains.kotlin.test.services
|
||||
|
||||
import org.jetbrains.kotlin.test.TestInfrastructureInternals
|
||||
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
|
||||
|
||||
abstract class ModuleStructureExtractor(
|
||||
abstract class ModuleStructureExtractor @OptIn(TestInfrastructureInternals::class) constructor(
|
||||
protected val testServices: TestServices,
|
||||
protected val additionalSourceProviders: List<AdditionalSourceProvider>
|
||||
protected val additionalSourceProviders: List<AdditionalSourceProvider>,
|
||||
protected val moduleStructureTransformers: List<ModuleStructureTransformer>
|
||||
) {
|
||||
abstract fun splitTestDataByModules(
|
||||
testDataFileName: String,
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
package org.jetbrains.kotlin.test.services
|
||||
|
||||
import org.jetbrains.kotlin.test.TestInfrastructureInternals
|
||||
|
||||
@TestInfrastructureInternals
|
||||
abstract class ModuleStructureTransformer {
|
||||
abstract fun transformModuleStructure(moduleStructure: TestModuleStructure): TestModuleStructure
|
||||
}
|
||||
Reference in New Issue
Block a user