also print the generated JavaScript on error

This commit is contained in:
Volker Berlin 2020-01-05 18:29:38 +01:00
parent 1d5f097dd8
commit f3bcd8e670

View File

@ -30,6 +30,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
@ -174,10 +175,21 @@ public class WasmRule extends TemporaryFolder {
*/
@Override
protected void after() {
super.after();
if( failed ) {
if( wasmFile != null ) {
File jsFile = new File( wasmFile.toString() + ".js" );
if( jsFile.isFile() ) {
try {
System.out.println( new String( Files.readAllBytes( jsFile.toPath() ), StandardCharsets.UTF_8 ) );
System.out.println();
} catch( IOException e ) {
e.printStackTrace();
}
}
}
System.out.println( textCompiled );
}
super.after();
}
/**