Fix IDE related test problems after adding ability to run test in parallel in compiler configuration
This commit is contained in:
@@ -428,9 +428,7 @@ public class KotlinTestUtils {
|
||||
|
||||
@NotNull
|
||||
public static File tmpDirForReusableLibrary(String name) throws IOException {
|
||||
File answer = normalizeFile(FileUtil.createTempDirectory(new File(System.getProperty("java.io.tmpdir")), name, ""));
|
||||
deleteOnShutdown(answer);
|
||||
return answer;
|
||||
return normalizeFile(FileUtil.createTempDirectory(new File(System.getProperty("java.io.tmpdir")), name, "", true));
|
||||
}
|
||||
|
||||
private static File normalizeFile(File file) throws IOException {
|
||||
|
||||
@@ -425,9 +425,7 @@ public class KotlinTestUtils {
|
||||
|
||||
@NotNull
|
||||
public static File tmpDirForReusableLibrary(String name) throws IOException {
|
||||
File answer = normalizeFile(FileUtil.createTempDirectory(new File(System.getProperty("java.io.tmpdir")), name, ""));
|
||||
deleteOnShutdown(answer);
|
||||
return answer;
|
||||
return normalizeFile(FileUtil.createTempDirectory(new File(System.getProperty("java.io.tmpdir")), name, "", true));
|
||||
}
|
||||
|
||||
private static File normalizeFile(File file) throws IOException {
|
||||
@@ -437,18 +435,6 @@ public class KotlinTestUtils {
|
||||
return file.getCanonicalFile();
|
||||
}
|
||||
|
||||
private static void deleteOnShutdown(File file) {
|
||||
if (filesToDelete.isEmpty()) {
|
||||
ShutDownTracker.getInstance().registerShutdownTask(() -> {
|
||||
for (File victim : filesToDelete) {
|
||||
FileUtil.delete(victim);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
filesToDelete.add(file);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static KtFile createFile(@NotNull @NonNls String name, @NotNull String text, @NotNull Project project) {
|
||||
String shortName = name.substring(name.lastIndexOf('/') + 1);
|
||||
|
||||
Reference in New Issue
Block a user