Generate instructions as text in case of other exceptions
It makes possible to analyze what causes a failure if DxChecker.check fails
This commit is contained in:
@@ -521,20 +521,7 @@ public abstract class CodegenTestCase extends KtUsefulTestCase {
|
||||
catch (TestsCompiletimeError e) {
|
||||
if (reportProblems) {
|
||||
e.getOriginal().printStackTrace();
|
||||
System.err.println("Generating instructions as text...");
|
||||
try {
|
||||
if (classFileFactory == null) {
|
||||
System.err.println("Cannot generate text: exception was thrown during generation");
|
||||
}
|
||||
else {
|
||||
System.err.println(classFileFactory.createText());
|
||||
}
|
||||
}
|
||||
catch (Throwable e1) {
|
||||
System.err.println("Exception thrown while trying to generate text, the actual exception follows:");
|
||||
e1.printStackTrace();
|
||||
System.err.println("-----------------------------------------------------------------------------");
|
||||
}
|
||||
generateInstructionsAsText();
|
||||
System.err.println("See exceptions above");
|
||||
}
|
||||
else {
|
||||
@@ -543,11 +530,31 @@ public abstract class CodegenTestCase extends KtUsefulTestCase {
|
||||
throw e;
|
||||
}
|
||||
catch (Throwable e) {
|
||||
if (reportProblems) {
|
||||
generateInstructionsAsText();
|
||||
}
|
||||
throw new TestsCompilerError(e);
|
||||
}
|
||||
return classFileFactory;
|
||||
}
|
||||
|
||||
private void generateInstructionsAsText() {
|
||||
System.err.println("Generating instructions as text...");
|
||||
try {
|
||||
if (classFileFactory == null) {
|
||||
System.err.println("Cannot generate text: exception was thrown during generation");
|
||||
}
|
||||
else {
|
||||
System.err.println(classFileFactory.createText());
|
||||
}
|
||||
}
|
||||
catch (Throwable e1) {
|
||||
System.err.println("Exception thrown while trying to generate text, the actual exception follows:");
|
||||
e1.printStackTrace();
|
||||
System.err.println("-----------------------------------------------------------------------------");
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean verifyWithDex() {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user