Remove temp directories in tests
There's new algo for temp file creation that starting to fail after ~1000 files have been created.
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.checkers;
|
||||
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.io.FilesKt;
|
||||
import kotlin.text.Charsets;
|
||||
@@ -70,6 +71,12 @@ public abstract class KotlinMultiFileTestWithJava<M, F> extends KotlinTestWithEn
|
||||
return KotlinCoreEnvironment.createForTests(getTestRootDisposable(), configuration, getEnvironmentConfigFiles());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void removeEnvironment() throws Exception {
|
||||
if (javaFilesDir != null) FileUtil.delete(javaFilesDir);
|
||||
if (kotlinSourceRoot != null) FileUtil.delete(kotlinSourceRoot);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
protected ConfigurationKind getConfigurationKind() {
|
||||
return ConfigurationKind.MOCK_RUNTIME;
|
||||
|
||||
@@ -31,11 +31,13 @@ public abstract class KotlinTestWithEnvironment extends KotlinTestWithEnvironmen
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
removeEnvironment();
|
||||
environment = null;
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
protected abstract KotlinCoreEnvironment createEnvironment() throws Exception;
|
||||
protected void removeEnvironment() throws Exception {}
|
||||
|
||||
@NotNull
|
||||
public KotlinCoreEnvironment getEnvironment() {
|
||||
|
||||
Reference in New Issue
Block a user