[Test] Properly delete temporary directories after test run

This commit is contained in:
Dmitriy Novozhilov
2021-01-12 12:16:13 +03:00
committed by TeamCityServer
parent ce44a2a7e4
commit 5382e68180
9 changed files with 69 additions and 11 deletions
@@ -48,6 +48,11 @@ public class KtTestUtil {
return normalizeFile(FileUtil.createTempDirectory(name, "", false));
}
@NotNull
public static File tmpDir(@NotNull File parentDir, @NotNull String name) throws IOException {
return normalizeFile(FileUtil.createTempDirectory(parentDir, name, "", false));
}
@NotNull
public static File tmpDirForReusableFolder(String name) throws IOException {
return normalizeFile(FileUtil.createTempDirectory(new File(System.getProperty("java.io.tmpdir")), name, "", true));