if (verbose()) {
System.out.println("Comparing " + source.getName());
}
stat.checking(source);
BoxRenderer renderer = new BoxRenderer(source, width);
Box box;
try {
box = renderer.render();
} catch (Exception e) {
stat.failedToRender(e);
storeFailed(failedDirectory, source);
if (verbose()) {
System.err.println("Could not render input file, skipping: " + source + " err: " + e.getMessage());
}
return;
}
LayoutContext layoutContext = renderer.getLayoutContext();
String inputFileName = source.getName();
String refRendered = trimTrailingLS(readReference(referenceDir, inputFileName, Regress.RENDER_SFX));
String rendered = trimTrailingLS(box.dump(layoutContext, "", Box.DUMP_RENDER));
if (!match(refRendered, rendered, stat)) {
storeFailed(failedDirectory, new File(referenceDir, inputFileName), Regress.RENDER_SFX, rendered);
}
final String refLaidOut = trimTrailingLS(readReference(referenceDir, inputFileName, Regress.LAYOUT_SFX));
final String laidOut = trimTrailingLS(box.dump(layoutContext, "", Box.DUMP_LAYOUT));
if (!match(refLaidOut, laidOut, stat)) {
storeFailed(failedDirectory, new File(referenceDir, inputFileName), Regress.LAYOUT_SFX, laidOut);
}
}