Ensure IC.isEnabled is not modified by tests
Original commit: 69b4d213b7
This commit is contained in:
+3
@@ -75,6 +75,7 @@ abstract class AbstractIncrementalJpsTest(
|
||||
protected lateinit var workDir: File
|
||||
protected lateinit var projectDescriptor: ProjectDescriptor
|
||||
protected lateinit var lookupsDuringTest: MutableSet<LookupSymbol>
|
||||
private var isICEnabledBackup: Boolean = false
|
||||
|
||||
protected var mapWorkingToOriginalFile: MutableMap<File, File> = hashMapOf()
|
||||
|
||||
@@ -110,6 +111,7 @@ abstract class AbstractIncrementalJpsTest(
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
lookupsDuringTest = hashSetOf()
|
||||
isICEnabledBackup = IncrementalCompilation.isEnabled()
|
||||
IncrementalCompilation.setIsEnabled(true)
|
||||
|
||||
if (DEBUG_LOGGING_ENABLED) {
|
||||
@@ -123,6 +125,7 @@ abstract class AbstractIncrementalJpsTest(
|
||||
(AbstractIncrementalJpsTest::projectDescriptor).javaField!![this] = null
|
||||
(AbstractIncrementalJpsTest::systemPropertiesBackup).javaField!![this] = null
|
||||
lookupsDuringTest.clear()
|
||||
IncrementalCompilation.setIsEnabled(isICEnabledBackup)
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
|
||||
+13
@@ -34,6 +34,19 @@ abstract class AbstractIncrementalLazyCachesTest : AbstractIncrementalJpsTest()
|
||||
private val expectedCachesFileName: String
|
||||
get() = "expected-kotlin-caches.txt"
|
||||
|
||||
private var isICEnabledBackup: Boolean = false
|
||||
|
||||
override fun setUp() {
|
||||
super.setUp()
|
||||
isICEnabledBackup = IncrementalCompilation.isEnabled()
|
||||
IncrementalCompilation.setIsEnabled(true)
|
||||
}
|
||||
|
||||
override fun tearDown() {
|
||||
IncrementalCompilation.setIsEnabled(isICEnabledBackup)
|
||||
super.tearDown()
|
||||
}
|
||||
|
||||
override fun doTest(testDataPath: String) {
|
||||
super.doTest(testDataPath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user