Better error reporting in codegen tests:

an exception from generateToText() used to mask the one from the original run
This commit is contained in:
Andrey Breslav
2013-03-28 17:17:27 +04:00
parent 089a2fc071
commit d612a1167d
@@ -166,7 +166,14 @@ public abstract class CodegenTestCase extends UsefulTestCase {
DxChecker.check(classFileFactory);
}
} catch (Throwable e) {
System.out.println(generateToText());
try {
System.out.println(generateToText());
}
catch (Throwable e1) {
System.err.println("Exception thrown while trying to generate text, the actual exception follows:");
e1.printStackTrace();
System.err.println("-----------------------------------------------------------------------------");
}
throw ExceptionUtils.rethrow(e);
}
}