https://github.com/rife2/bld-pitest
PIT Mutation Testing and Coverage for bld
https://github.com/rife2/bld-pitest
bld build build-system build-tool build-tool-plugin coverage extension mutation-testing pit pitest test testing
Last synced: about 1 month ago
JSON representation
PIT Mutation Testing and Coverage for bld
- Host: GitHub
- URL: https://github.com/rife2/bld-pitest
- Owner: rife2
- License: apache-2.0
- Created: 2023-08-29T15:52:16.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2026-01-03T22:55:50.000Z (3 months ago)
- Last Synced: 2026-01-06T02:08:11.156Z (3 months ago)
- Topics: bld, build, build-system, build-tool, build-tool-plugin, coverage, extension, mutation-testing, pit, pitest, test, testing
- Language: Java
- Homepage:
- Size: 550 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# [PIT Mutation Testing](https://pitest.org/) Extension for [bld](https://rife2.com/bld)
[](https://opensource.org/licenses/Apache-2.0)
[](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
[](https://rife2.com/bld)
[](https://repo.rife2.com/#/releases/com/uwyn/rife2/bld-pitest)
[](https://repo.rife2.com/#/snapshots/com/uwyn/rife2/bld-pitest)
[](https://github.com/rife2/bld-pitest/actions/workflows/bld.yml)
To install the latest version, add the following to the
`lib/bld/bld-wrapper.properties` file:
```properties
bld.extension-pitest=com.uwyn.rife2:bld-pitest
```
For more information, please refer to the
[extensions](https://github.com/rife2/bld/wiki/Extensions) documentation.
## Mutation Testing with PIT
To run mutation tests and coverage, add the following to your build file:
```java
@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();
}
```
```console
./bld compile pit
```
- [View Examples Project](https://github.com/rife2/bld-pitest/blob/master/examples/src/bld/java/com/example/)
Please check the
[PitestOperation documentation](https://rife2.github.io/bld-pitest/rife/bld/extension/PitestOperation.html#method-summary)
for all available configuration options.
## Pitest (PIT) Dependency
Don't forget to add the Pitest `test` dependencies to your build file, as the
are not provided by the extension. For example:
```java
repositories = List.of(MAVEN_CENTRAL);
scope(test)
.include(dependency("org.pitest", "pitest", version(1, 23, 0)))
.include(dependency("org.pitest", "pitest-command-line", version(1, 23, 0)))
.include(dependency("org.pitest", "pitest-junit5-plugin", version(1, 2, 3)))
.include(dependency("org.pitest", "pitest-testng-plugin", version(1, 0, 0)));
```