String[] (Module module, int index) { String[] outputs = new String[2]; String prefix = "outputs" + File.separatorChar; VirtualFile generalOutput = findFile(prefix + "general " + index); VirtualFile testOutput = findFile(prefix + "tests" + index); outputs[0] = generalOutput.getPresentableUrl(); outputs[1] = testOutput.getPresentableUrl(); PsiTestUtil.setCompilerOutputPath(module, generalOutput.getUrl(), false); PsiTestUtil.setCompilerOutputPath(module, testOutput.getUrl(), true); Disposer.register(getTestRootDisposable(), new Disposable() { @Override public void dispose() { for (File file : new File(outputs[1]).listFiles()) { if (file.getName().equals("keep.dir")) continue; FileUtil.delete(file); } } }); return outputs; }