[Tests] Fix reporting when FirLoadCompiledKotlinTest can be unmuted
This commit is contained in:
committed by
Space Team
parent
c129e91bd6
commit
8dad097841
+4
-12
@@ -6,15 +6,10 @@
|
|||||||
package org.jetbrains.kotlin.test
|
package org.jetbrains.kotlin.test
|
||||||
|
|
||||||
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
|
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
|
||||||
import org.jetbrains.kotlin.test.directives.extractIgnoredDirectivesForTargetBackend
|
|
||||||
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
|
import org.jetbrains.kotlin.test.directives.model.DirectivesContainer
|
||||||
import org.jetbrains.kotlin.test.directives.model.SimpleDirective
|
|
||||||
import org.jetbrains.kotlin.test.directives.model.ValueDirective
|
|
||||||
import org.jetbrains.kotlin.test.model.AfterAnalysisChecker
|
import org.jetbrains.kotlin.test.model.AfterAnalysisChecker
|
||||||
import org.jetbrains.kotlin.test.model.FrontendKinds
|
import org.jetbrains.kotlin.test.services.TestServices
|
||||||
import org.jetbrains.kotlin.test.model.TestModule
|
import org.jetbrains.kotlin.test.services.moduleStructure
|
||||||
import org.jetbrains.kotlin.test.services.*
|
|
||||||
import org.jetbrains.kotlin.utils.addToStdlib.shouldNotBeCalled
|
|
||||||
|
|
||||||
class FirMetadataLoadingTestSuppressor(testServices: TestServices) : AfterAnalysisChecker(testServices) {
|
class FirMetadataLoadingTestSuppressor(testServices: TestServices) : AfterAnalysisChecker(testServices) {
|
||||||
override val directiveContainers: List<DirectivesContainer>
|
override val directiveContainers: List<DirectivesContainer>
|
||||||
@@ -22,11 +17,7 @@ class FirMetadataLoadingTestSuppressor(testServices: TestServices) : AfterAnalys
|
|||||||
|
|
||||||
override fun suppressIfNeeded(failedAssertions: List<WrappedException>): List<WrappedException> {
|
override fun suppressIfNeeded(failedAssertions: List<WrappedException>): List<WrappedException> {
|
||||||
val moduleStructure = testServices.moduleStructure
|
val moduleStructure = testServices.moduleStructure
|
||||||
val directive = when (testServices.defaultsProvider.defaultFrontend) {
|
val directive = testServices.loadedMetadataSuppressionDirective
|
||||||
FrontendKinds.ClassicFrontend -> CodegenTestDirectives.IGNORE_FIR_METADATA_LOADING_K1
|
|
||||||
FrontendKinds.FIR -> CodegenTestDirectives.IGNORE_FIR_METADATA_LOADING_K2
|
|
||||||
else -> shouldNotBeCalled()
|
|
||||||
}
|
|
||||||
if (moduleStructure.modules.any { directive in it.directives }) {
|
if (moduleStructure.modules.any { directive in it.directives }) {
|
||||||
return if (failedAssertions.isNotEmpty()) {
|
return if (failedAssertions.isNotEmpty()) {
|
||||||
emptyList()
|
emptyList()
|
||||||
@@ -36,4 +27,5 @@ class FirMetadataLoadingTestSuppressor(testServices: TestServices) : AfterAnalys
|
|||||||
}
|
}
|
||||||
return failedAssertions
|
return failedAssertions
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2023 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
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.test.directives.CodegenTestDirectives
|
||||||
|
import org.jetbrains.kotlin.test.directives.model.SimpleDirective
|
||||||
|
import org.jetbrains.kotlin.test.model.FrontendKinds
|
||||||
|
import org.jetbrains.kotlin.test.services.TestServices
|
||||||
|
import org.jetbrains.kotlin.test.services.defaultsProvider
|
||||||
|
import org.jetbrains.kotlin.utils.addToStdlib.shouldNotBeCalled
|
||||||
|
|
||||||
|
val TestServices.loadedMetadataSuppressionDirective: SimpleDirective
|
||||||
|
get() = when (defaultsProvider.defaultFrontend) {
|
||||||
|
FrontendKinds.ClassicFrontend -> CodegenTestDirectives.IGNORE_FIR_METADATA_LOADING_K1
|
||||||
|
FrontendKinds.FIR -> CodegenTestDirectives.IGNORE_FIR_METADATA_LOADING_K2
|
||||||
|
else -> shouldNotBeCalled()
|
||||||
|
}
|
||||||
+1
@@ -41,6 +41,7 @@ class LoadedMetadataDumpHandler(testServices: TestServices) : JvmBinaryArtifactH
|
|||||||
private val dumper: MultiModuleInfoDumper = MultiModuleInfoDumper()
|
private val dumper: MultiModuleInfoDumper = MultiModuleInfoDumper()
|
||||||
|
|
||||||
override fun processModule(module: TestModule, info: BinaryArtifacts.Jvm) {
|
override fun processModule(module: TestModule, info: BinaryArtifacts.Jvm) {
|
||||||
|
if (testServices.loadedMetadataSuppressionDirective in module.directives) return
|
||||||
val emptyModule = TestModule(
|
val emptyModule = TestModule(
|
||||||
name = "empty", JvmPlatforms.defaultJvmPlatform, TargetBackend.JVM_IR, FrontendKinds.FIR,
|
name = "empty", JvmPlatforms.defaultJvmPlatform, TargetBackend.JVM_IR, FrontendKinds.FIR,
|
||||||
BackendKinds.IrBackend, ArtifactKinds.Jvm, files = emptyList(),
|
BackendKinds.IrBackend, ArtifactKinds.Jvm, files = emptyList(),
|
||||||
|
|||||||
Reference in New Issue
Block a user