FIR IDE: add ability to run multimodule tests
This commit is contained in:
committed by
teamcityserver
parent
1cb34541bd
commit
a9bb577154
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.test.directives.model.RegisteredDirectives
|
||||
import org.jetbrains.kotlin.test.model.*
|
||||
import org.jetbrains.kotlin.test.services.MetaTestConfigurator
|
||||
import org.jetbrains.kotlin.test.services.ModuleStructureExtractor
|
||||
import org.jetbrains.kotlin.test.services.PreAnalysisHandler
|
||||
import org.jetbrains.kotlin.test.services.TestServices
|
||||
|
||||
typealias Constructor<T> = (TestServices) -> T
|
||||
@@ -26,6 +27,8 @@ abstract class TestConfiguration {
|
||||
|
||||
abstract val moduleStructureExtractor: ModuleStructureExtractor
|
||||
|
||||
abstract val preAnalysisHandlers: List<PreAnalysisHandler>
|
||||
|
||||
abstract val metaTestConfigurators: List<MetaTestConfigurator>
|
||||
|
||||
abstract val afterAnalysisCheckers: List<AfterAnalysisChecker>
|
||||
|
||||
@@ -52,6 +52,7 @@ class TestRunner(private val testConfiguration: TestConfiguration) {
|
||||
throw exception
|
||||
}
|
||||
|
||||
|
||||
testConfiguration.metaTestConfigurators.forEach {
|
||||
if (it.shouldSkipTest()) return
|
||||
}
|
||||
@@ -62,6 +63,11 @@ class TestRunner(private val testConfiguration: TestConfiguration) {
|
||||
val modules = moduleStructure.modules
|
||||
val dependencyProvider = DependencyProviderImpl(services, modules)
|
||||
services.registerDependencyProvider(dependencyProvider)
|
||||
|
||||
testConfiguration.preAnalysisHandlers.forEach { preprocessor ->
|
||||
preprocessor.preprocessModuleStructure(moduleStructure)
|
||||
}
|
||||
|
||||
var failedException: WrappedException? = null
|
||||
try {
|
||||
for (module in modules) {
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* 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
|
||||
|
||||
abstract class PreAnalysisHandler(protected val testServices: TestServices) {
|
||||
abstract fun preprocessModuleStructure(moduleStructure: TestModuleStructure)
|
||||
}
|
||||
Reference in New Issue
Block a user