Do not store project in JPS tests after they're executed
This saves a couple dozen megabytes currently
This commit is contained in:
+10
-9
@@ -58,7 +58,7 @@ import java.io.ByteArrayOutputStream
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.PrintStream
|
import java.io.PrintStream
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import kotlin.properties.Delegates
|
import kotlin.reflect.jvm.javaField
|
||||||
|
|
||||||
abstract class AbstractIncrementalJpsTest(
|
abstract class AbstractIncrementalJpsTest(
|
||||||
private val allowNoFilesWithSuffixInTestData: Boolean = false,
|
private val allowNoFilesWithSuffixInTestData: Boolean = false,
|
||||||
@@ -80,13 +80,10 @@ abstract class AbstractIncrementalJpsTest(
|
|||||||
|
|
||||||
protected open val enableExperimentalIncrementalCompilation = false
|
protected open val enableExperimentalIncrementalCompilation = false
|
||||||
|
|
||||||
protected var testDataDir: File by Delegates.notNull()
|
protected lateinit var testDataDir: File
|
||||||
|
protected lateinit var workDir: File
|
||||||
protected var workDir: File by Delegates.notNull()
|
protected lateinit var projectDescriptor: ProjectDescriptor
|
||||||
|
protected lateinit var lookupsDuringTest: MutableSet<LookupSymbol>
|
||||||
protected var projectDescriptor: ProjectDescriptor by Delegates.notNull()
|
|
||||||
|
|
||||||
protected var lookupsDuringTest: MutableSet<LookupSymbol> by Delegates.notNull()
|
|
||||||
|
|
||||||
protected var mapWorkingToOriginalFile: MutableMap<File, File> = hashMapOf()
|
protected var mapWorkingToOriginalFile: MutableMap<File, File> = hashMapOf()
|
||||||
|
|
||||||
@@ -105,7 +102,7 @@ abstract class AbstractIncrementalJpsTest(
|
|||||||
Logger.getRootLogger().addAppender(console)
|
Logger.getRootLogger().addAppender(console)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val systemPropertiesBackup = run {
|
private var systemPropertiesBackup = run {
|
||||||
val props = System.getProperties()
|
val props = System.getProperties()
|
||||||
val output = ByteArrayOutputStream()
|
val output = ByteArrayOutputStream()
|
||||||
props.store(output, "System properties backup")
|
props.store(output, "System properties backup")
|
||||||
@@ -132,6 +129,10 @@ abstract class AbstractIncrementalJpsTest(
|
|||||||
|
|
||||||
override fun tearDown() {
|
override fun tearDown() {
|
||||||
restoreSystemProperties()
|
restoreSystemProperties()
|
||||||
|
(AbstractIncrementalJpsTest::myProject).javaField!![this] = null
|
||||||
|
(AbstractIncrementalJpsTest::projectDescriptor).javaField!![this] = null
|
||||||
|
(AbstractIncrementalJpsTest::systemPropertiesBackup).javaField!![this] = null
|
||||||
|
lookupsDuringTest.clear()
|
||||||
super.tearDown()
|
super.tearDown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user