From 703fd8539d470695d5f30c223248bfff01df626d Mon Sep 17 00:00:00 2001 From: Dmitriy Dolovov Date: Tue, 18 Jan 2022 20:32:22 +0300 Subject: [PATCH] [IR, JS] KLIB ABI tests: don't create unnecessary disposable ^KT-50775 --- .../org/jetbrains/kotlin/klib/AbstractKlibABITestCase.kt | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/klib/AbstractKlibABITestCase.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/klib/AbstractKlibABITestCase.kt index 5e7b4bf3f36..b842223efbc 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/klib/AbstractKlibABITestCase.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/klib/AbstractKlibABITestCase.kt @@ -52,15 +52,13 @@ abstract class AbstractKlibABITestCase : KtUsefulTestCase() { modulesMap[module] = parseModuleInfo(module, moduleInfoFile) } - val disposable = TestDisposable() - val environment = createEnvironment(disposable) + val environment = createEnvironment() val buildDir = createTempDirectory().toFile().also { it.mkdirs() } try { doTestImpl(environment, testDir, buildDir, projectInfo, modulesMap) } finally { buildDir.deleteRecursively() - disposable.dispose() } } @@ -89,8 +87,8 @@ abstract class AbstractKlibABITestCase : KtUsefulTestCase() { return modulesBuildDirs } - private fun createEnvironment(disposable: TestDisposable): KotlinCoreEnvironment { - return KotlinCoreEnvironment.createForTests(disposable, CompilerConfiguration(), EnvironmentConfigFiles.JS_CONFIG_FILES) + private fun createEnvironment(): KotlinCoreEnvironment { + return KotlinCoreEnvironment.createForTests(testRootDisposable, CompilerConfiguration(), EnvironmentConfigFiles.JS_CONFIG_FILES) } private fun collectDependenciesKlib(buildDir: File, dependencies: Collection): List {