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:
@@ -118,13 +118,19 @@ public class ForTestCompileStdlib {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static Throwable compilationException;
|
||||||
|
|
||||||
public static File stdlibJarForTests() {
|
public static File stdlibJarForTests() {
|
||||||
synchronized (ForTestCompileStdlib.class) {
|
synchronized (ForTestCompileStdlib.class) {
|
||||||
|
if (compilationException != null) {
|
||||||
|
throw new RuntimeException("stdlib compilation failed in previous tests: " + compilationException, compilationException);
|
||||||
|
}
|
||||||
if (stdlibJarFile == null || !stdlibJarFile.exists()) {
|
if (stdlibJarFile == null || !stdlibJarFile.exists()) {
|
||||||
try {
|
try {
|
||||||
stdlibJarFile = doCompile();
|
stdlibJarFile = doCompile();
|
||||||
} catch (Exception e) {
|
} catch (Throwable e) {
|
||||||
|
compilationException = e;
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user