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) {
|
catch (TestsCompiletimeError e) {
|
||||||
if (reportProblems) {
|
if (reportProblems) {
|
||||||
e.getOriginal().printStackTrace();
|
e.getOriginal().printStackTrace();
|
||||||
System.err.println("Generating instructions as text...");
|
generateInstructionsAsText();
|
||||||
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("-----------------------------------------------------------------------------");
|
|
||||||
}
|
|
||||||
System.err.println("See exceptions above");
|
System.err.println("See exceptions above");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -543,11 +530,31 @@ public abstract class CodegenTestCase extends KtUsefulTestCase {
|
|||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
catch (Throwable e) {
|
catch (Throwable e) {
|
||||||
|
if (reportProblems) {
|
||||||
|
generateInstructionsAsText();
|
||||||
|
}
|
||||||
throw new TestsCompilerError(e);
|
throw new TestsCompilerError(e);
|
||||||
}
|
}
|
||||||
return classFileFactory;
|
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() {
|
protected boolean verifyWithDex() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user