fixup! Generate and convert JUnit test reports for xunit-viewer

This commit is contained in:
Erik C. Thauvin 2025-05-19 12:36:47 -07:00
parent 5b2090a231
commit 513fb0beb3
Signed by: erik
GPG key ID: 776702A6A2DA330E

View file

@ -122,7 +122,13 @@ public class PitestOperationBuild extends Project {
var testResultsDir = "build/test-results/test/";
var op = testOperation().fromProject(this);
op.testToolOptions().reportsDir(new File(testResultsDir));
op.execute();
Exception ex = null;
try {
op.execute();
} catch (Exception e) {
ex = e;
}
var xunitViewer = new File("/usr/bin/xunit-viewer");
if (xunitViewer.exists() && xunitViewer.canExecute()) {
@ -135,5 +141,9 @@ public class PitestOperationBuild extends Project {
.command(xunitViewer.getPath(), "-r", testResultsDir, "-o", reportsDir + "index.html")
.execute();
}
if (ex != null) {
throw ex;
}
}
}