do not compile stdlib more then once for tests

if stdlib compilation fails then next test starts compilation again,
so all tests execute too long
This commit is contained in:
Stepan Koltsov
2012-02-09 17:12:35 +04:00
parent d69739a3d2
commit 02eb0201ea
@@ -118,13 +118,19 @@ public class ForTestCompileStdlib {
}
}
private static Throwable compilationException;
public static File stdlibJarForTests() {
synchronized (ForTestCompileStdlib.class) {
if (compilationException != null) {
throw new RuntimeException("stdlib compilation failed in previous tests: " + compilationException, compilationException);
}
if (stdlibJarFile == null || !stdlibJarFile.exists()) {
try {
stdlibJarFile = doCompile();
} catch (Exception e) {
} catch (Throwable e) {
compilationException = e;
throw new RuntimeException(e);
}
}