PIT Mutation Testing and Coverage for bld https://github.com/rife2/bld-pitest
Find a file
Erik C. Thauvin 926580f12e
Updated extensions dependencies
Bump PMD from 1.2.1 to 1.2.2
Bump Exec from 1.0.4 to 1.0.5
2025-03-28 11:19:37 -07:00
.github/workflows Add OS matrix for Ubuntu, Windows and macOS 2025-03-25 13:15:09 -07:00
.idea Bump bld to version 2.2.1 2025-02-24 22:54:59 -08:00
.vscode Bump bld to version 2.2.1 2025-02-24 22:54:59 -08:00
config Updated dependencies 2024-10-27 17:10:59 -07:00
examples Enabled extensions logging 2025-03-25 13:29:33 -07:00
lib/bld Updated extensions dependencies 2025-03-28 11:19:37 -07:00
scripts Execute cliargs script before running tests 2024-05-28 14:27:54 -07:00
src Cleanup workaround 2025-03-25 15:28:40 -07:00
.gitignore Inital commit 2023-08-29 08:47:13 -07:00
bld Inital commit 2023-08-29 08:47:13 -07:00
bld.bat Inital commit 2023-08-29 08:47:13 -07:00
LICENSE.txt Inital commit 2023-08-29 08:47:13 -07:00
README.md Add generic installation instructions 2025-03-18 13:04:31 -07:00

PIT Mutation Testing Extension for bld

License Java bld Release Snapshot GitHub CI

To install the latest version, add the following to the lib/bld/bld-wrapper.properties file:

bld.extension-pitest=com.uwyn.rife2:bld-pitest

For more information, please refer to the extensions documentation.

Mutation Testing with PIT

To run mutation tests and coverage, add the following to your build file:

@BuildCommand(summary = "Run PIT mutation tests")
public void pit() throws Exception {
    new PitestOperation()
        .fromProject(this)
        .reportDir(Path.of("reports", "mutations"))
        .targetClasses(pkg + ".*")
        .targetTests(pkg + ".*")
        .verbose(true)
        .execute();
    }
./bld compile pit

Please check the PitestOperation documentation for all available configuration options.

Pitest (PIT) Dependency

Don't forget to add the Pitest test dependencies to your build file, as they are not provided by the extension. For example:

repositories = List.of(MAVEN_CENTRAL);
scope(test)
    .include(dependency("org.pitest", "pitest", version(1, 19, 0)))
    .include(dependency("org.pitest", "pitest-command-line", version(1, 17, 4)))
    .include(dependency("org.pitest", "pitest-junit5-plugin", version(1, 2, 2)))
    .include(dependency("org.pitest", "pitest-testng-plugin", version(1, 0, 0)));