From 02eb0201ea1e998a4588620ae80d50eb93553d56 Mon Sep 17 00:00:00 2001 From: Stepan Koltsov Date: Thu, 9 Feb 2012 17:12:35 +0400 Subject: [PATCH] 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 --- .../org/jetbrains/jet/codegen/ForTestCompileStdlib.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.java b/compiler/tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.java index 893acc6fbf2..ccdb111d320 100644 --- a/compiler/tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.java +++ b/compiler/tests/org/jetbrains/jet/codegen/ForTestCompileStdlib.java @@ -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); } }