[Test] Replace three fixed phases of tests with step system
Now each test is just a sequence of any number of different steps. There are two kinds of steps: 1. Run some facade 2. Run handlers of specific artifact kind Through the test each module passed to each step (if it is compatible by kinds of artifacts)
This commit is contained in:
committed by
teamcityserver
parent
ba48f80e53
commit
a66f3d26fd
+1
-2
@@ -83,10 +83,9 @@ abstract class AbstractCompilerBasedTest : AbstractKotlinCompilerTest() {
|
||||
|
||||
configureTest()
|
||||
defaultConfiguration(this)
|
||||
unregisterAllFacades()
|
||||
|
||||
useAdditionalService(::TestModuleInfoProvider)
|
||||
usePreAnalysisHandlers(::ModuleRegistrarPreAnalysisHandler.bind(disposable))
|
||||
useFrontendFacades(::LowLevelFirFrontendFacade)
|
||||
}
|
||||
|
||||
open fun TestConfigurationBuilder.configureTest() {}
|
||||
|
||||
+2
-2
@@ -13,8 +13,8 @@ import org.jetbrains.kotlin.test.runners.baseFirSpecDiagnosticTestConfiguration
|
||||
|
||||
abstract class AbstractDiagnosisCompilerTestDataSpecTest : AbstractCompilerBasedTest() {
|
||||
override fun TestConfigurationBuilder.configureTest() {
|
||||
baseFirDiagnosticTestConfiguration()
|
||||
baseFirDiagnosticTestConfiguration(frontendFacade = ::LowLevelFirFrontendFacade)
|
||||
baseFirSpecDiagnosticTestConfiguration()
|
||||
addIdeTestIgnoreHandler()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@ import org.jetbrains.kotlin.test.runners.baseFirDiagnosticTestConfiguration
|
||||
|
||||
abstract class AbstractDiagnosisCompilerTestDataTest : AbstractCompilerBasedTest() {
|
||||
override fun TestConfigurationBuilder.configureTest() {
|
||||
baseFirDiagnosticTestConfiguration()
|
||||
baseFirDiagnosticTestConfiguration(frontendFacade = ::LowLevelFirFrontendFacade)
|
||||
addIdeTestIgnoreHandler()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -24,6 +24,7 @@ import org.jetbrains.kotlin.test.builders.testConfiguration
|
||||
import org.jetbrains.kotlin.test.directives.JvmEnvironmentConfigurationDirectives
|
||||
import org.jetbrains.kotlin.test.model.DependencyKind
|
||||
import org.jetbrains.kotlin.test.model.FrontendKinds
|
||||
import org.jetbrains.kotlin.test.model.ResultingArtifact
|
||||
import org.jetbrains.kotlin.test.runners.AbstractKotlinCompilerTest
|
||||
import org.jetbrains.kotlin.test.services.*
|
||||
import org.jetbrains.kotlin.test.services.configuration.CommonEnvironmentConfigurator
|
||||
@@ -61,6 +62,7 @@ abstract class AbstractLowLevelApiTest : TestWithDisposable() {
|
||||
usePreAnalysisHandlers(::ModuleRegistrarPreAnalysisHandler.bind(disposable))
|
||||
configureTest(this)
|
||||
|
||||
startingArtifactFactory = { ResultingArtifact.Source() }
|
||||
this.testInfo = this@AbstractLowLevelApiTest.testInfo
|
||||
}
|
||||
|
||||
@@ -136,4 +138,4 @@ fun String.indexOfOrNull(substring: String) =
|
||||
indexOf(substring).takeIf { it >= 0 }
|
||||
|
||||
private fun String.indexOfOrNull(substring: String, startingIndex: Int) =
|
||||
indexOf(substring, startingIndex).takeIf { it >= 0 }
|
||||
indexOf(substring, startingIndex).takeIf { it >= 0 }
|
||||
|
||||
Reference in New Issue
Block a user