Generate and convert JUnit test reports for xunit-viewer
This commit is contained in:
parent
cbf863be15
commit
c0231964d3
2 changed files with 21 additions and 1 deletions
1
.idea/inspectionProfiles/Project_Default.xml
generated
1
.idea/inspectionProfiles/Project_Default.xml
generated
|
@ -4,5 +4,6 @@
|
|||
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="ADDITIONAL_TAGS" value="created" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="UsePropertyAccessSyntax" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
||||
</profile>
|
||||
</component>
|
|
@ -22,6 +22,9 @@ import rife.bld.publish.PublishDeveloper;
|
|||
import rife.bld.publish.PublishLicense;
|
||||
import rife.bld.publish.PublishScm;
|
||||
|
||||
import java.io.File;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
|
||||
import static rife.bld.dependencies.Repository.*;
|
||||
|
@ -115,6 +118,22 @@ public class PitestOperationBuild extends Project {
|
|||
.command("scripts/cliargs.sh")
|
||||
.execute();
|
||||
}
|
||||
super.test();
|
||||
|
||||
var testResultsDir = "build/test-results/test/";
|
||||
var op = testOperation().fromProject(this);
|
||||
op.testToolOptions().reportsDir(new File(testResultsDir));
|
||||
op.execute();
|
||||
|
||||
var xunitViewer = new File("/usr/bin/xunit-viewer");
|
||||
if (xunitViewer.exists() && xunitViewer.canExecute()) {
|
||||
var reportsDir = "build/reports/tests/test/";
|
||||
|
||||
Files.createDirectories(Path.of(reportsDir));
|
||||
|
||||
new ExecOperation()
|
||||
.fromProject(this)
|
||||
.command(xunitViewer.getPath(), "-r", testResultsDir, "-o", reportsDir + "index.html")
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue