[IR, JS] KLIB ABI tests: don't create unnecessary disposable
^KT-50775
This commit is contained in:
@@ -52,15 +52,13 @@ abstract class AbstractKlibABITestCase : KtUsefulTestCase() {
|
|||||||
modulesMap[module] = parseModuleInfo(module, moduleInfoFile)
|
modulesMap[module] = parseModuleInfo(module, moduleInfoFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
val disposable = TestDisposable()
|
val environment = createEnvironment()
|
||||||
val environment = createEnvironment(disposable)
|
|
||||||
val buildDir = createTempDirectory().toFile().also { it.mkdirs() }
|
val buildDir = createTempDirectory().toFile().also { it.mkdirs() }
|
||||||
|
|
||||||
try {
|
try {
|
||||||
doTestImpl(environment, testDir, buildDir, projectInfo, modulesMap)
|
doTestImpl(environment, testDir, buildDir, projectInfo, modulesMap)
|
||||||
} finally {
|
} finally {
|
||||||
buildDir.deleteRecursively()
|
buildDir.deleteRecursively()
|
||||||
disposable.dispose()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -89,8 +87,8 @@ abstract class AbstractKlibABITestCase : KtUsefulTestCase() {
|
|||||||
return modulesBuildDirs
|
return modulesBuildDirs
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createEnvironment(disposable: TestDisposable): KotlinCoreEnvironment {
|
private fun createEnvironment(): KotlinCoreEnvironment {
|
||||||
return KotlinCoreEnvironment.createForTests(disposable, CompilerConfiguration(), EnvironmentConfigFiles.JS_CONFIG_FILES)
|
return KotlinCoreEnvironment.createForTests(testRootDisposable, CompilerConfiguration(), EnvironmentConfigFiles.JS_CONFIG_FILES)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun collectDependenciesKlib(buildDir: File, dependencies: Collection<String>): List<String> {
|
private fun collectDependenciesKlib(buildDir: File, dependencies: Collection<String>): List<String> {
|
||||||
|
|||||||
Reference in New Issue
Block a user