From 6b14d1537459a696269c707d91218e0b3daf6522 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Thu, 7 Sep 2017 18:21:09 +0300 Subject: [PATCH] Clean state in AbstractKotlinKapt3IntegrationTest --- .../test/AbstractKotlinKapt3IntegrationTest.kt | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/plugins/kapt3/test/org/jetbrains/kotlin/kapt3/test/AbstractKotlinKapt3IntegrationTest.kt b/plugins/kapt3/test/org/jetbrains/kotlin/kapt3/test/AbstractKotlinKapt3IntegrationTest.kt index f55082db57b..aea49874a30 100644 --- a/plugins/kapt3/test/org/jetbrains/kotlin/kapt3/test/AbstractKotlinKapt3IntegrationTest.kt +++ b/plugins/kapt3/test/org/jetbrains/kotlin/kapt3/test/AbstractKotlinKapt3IntegrationTest.kt @@ -53,8 +53,17 @@ abstract class AbstractKotlinKapt3IntegrationTest : CodegenTestCase() { val TEST_DATA_DIR = File("plugins/kapt3/testData/kotlinRunner") } - private lateinit var processors: List - private lateinit var options: Map + private var _processors: List? = null + private val processors get() = _processors!! + + private var _options: Map? = null + private val options get() = _options!! + + override fun tearDown() { + _processors = null + _options = null + super.tearDown() + } protected fun test( name: String, @@ -70,7 +79,7 @@ abstract class AbstractKotlinKapt3IntegrationTest : CodegenTestCase() { process: (Set, RoundEnvironment, ProcessingEnvironment) -> Unit, vararg supportedAnnotations: String ) { - this.options = options + this._options = options val ktFileName = File(TEST_DATA_DIR, name + ".kt") var started = false @@ -104,7 +113,7 @@ abstract class AbstractKotlinKapt3IntegrationTest : CodegenTestCase() { override fun getSupportedAnnotationTypes() = supportedAnnotations.toSet() } - processors = listOf(processor) + _processors = listOf(processor) doTest(ktFileName.canonicalPath) if (started != shouldRun) {