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;
|
package org.jetbrains.kotlin.checkers;
|
||||||
|
|
||||||
|
import com.intellij.openapi.util.io.FileUtil;
|
||||||
import kotlin.collections.CollectionsKt;
|
import kotlin.collections.CollectionsKt;
|
||||||
import kotlin.io.FilesKt;
|
import kotlin.io.FilesKt;
|
||||||
import kotlin.text.Charsets;
|
import kotlin.text.Charsets;
|
||||||
@@ -70,6 +71,12 @@ public abstract class KotlinMultiFileTestWithJava<M, F> extends KotlinTestWithEn
|
|||||||
return KotlinCoreEnvironment.createForTests(getTestRootDisposable(), configuration, getEnvironmentConfigFiles());
|
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
|
@NotNull
|
||||||
protected ConfigurationKind getConfigurationKind() {
|
protected ConfigurationKind getConfigurationKind() {
|
||||||
return ConfigurationKind.MOCK_RUNTIME;
|
return ConfigurationKind.MOCK_RUNTIME;
|
||||||
|
|||||||
@@ -31,11 +31,13 @@ public abstract class KotlinTestWithEnvironment extends KotlinTestWithEnvironmen
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void tearDown() throws Exception {
|
protected void tearDown() throws Exception {
|
||||||
|
removeEnvironment();
|
||||||
environment = null;
|
environment = null;
|
||||||
super.tearDown();
|
super.tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract KotlinCoreEnvironment createEnvironment() throws Exception;
|
protected abstract KotlinCoreEnvironment createEnvironment() throws Exception;
|
||||||
|
protected void removeEnvironment() throws Exception {}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public KotlinCoreEnvironment getEnvironment() {
|
public KotlinCoreEnvironment getEnvironment() {
|
||||||
|
|||||||
Reference in New Issue
Block a user