Plugin to run PITest in your Java/Kotlin project using Maven or Gradle. The plugin builds and runs PITest mutation coverage commands for you.
Requisites:
- A Maven/Gradle project.
- For Maven: pitest-maven configured on your project.
- For Gradle: gradle-pitest-plugin configured on your project.
NOTE: if you use Gradle you need to do extra steps to make PITest Helper work: Setup Gradle project.
Usage:
- Right-click on your classes and packages you want to run mutation coverage and click Run Mutation Coverage...
Are you experiencing problems with the plugin? Do you have any suggestion? You can create an issue at the Plugin Site
PITest logo used in this plugin was created by Ling Yeung.
PITest Helper relies on pitest-maven (for Maven) and gradle-pitest-plugin (for Gradle) plugins to work. You need to configure the corresponding plugin in your project beforehand.
For projects using Maven, you only need to set up pitest-maven plugin. You can follow the official PIT instructions for Maven at the following link:
If your project already has the PITest plugin configured, ignore this step.
For projects using Gradle, you need to follow the next steps.
Add the gradle-pitest-plugin plugin, edit your build.gradle
(or build.gradle.kts
for Kotlin DSL) file by adding the following code:
plugins {
id 'info.solidsoft.pitest' version '1.15.0' // Choose your version
// Other plugins...
}
plugins {
id("info.solidsoft.pitest") version ("1.15.0") // Choose your version
// Other plugins...
}
For more details on configuring the gradle-pitest-plugin for PITest in Gradle, visit the official plugin documentation.
Unlike the Maven plugin, gradle-pitest-plugin does not support command-line arguments to configure the PITest execution.
To support this you need to load properties manually and pass its values to the property providers the plugin uses.
I have made a simple plugin that make the things easy for you: properties-manager.
Below you have the instructions to use it:
Add the plugin to your project and binds the properties to the property providers:
plugins {
id 'io.github.cquilezg.properties-manager' version '1.0'
// Other plugins
}
pitest {
propertyManager.bindMultiValueProperty(project, targetClasses, "pitest.targetClasses", String)
propertyManager.bindMultiValueProperty(project, targetTests, "pitest.targetTests", String)
// More PITest config...
}
plugins {
id("io.github.cquilezg.properties-manager") version ("1.0")
// Other plugins
}
pitest {
propertyManager.bindMultiValueProperty(project, targetClasses, "pitest.targetClasses", String::class.java)
propertyManager.bindMultiValueProperty(project, targetTests, "pitest.targetTests", String::class.java)
// More PITest config...
}
Now you can run commands with PITest Helper!
Currently, PITest Helper supports only these properties to customize your PITest command:
gradle-pitest-plugin property | PITest Helper property |
---|---|
targetClasses | pitest.targetClasses |
targetTests | pitest.targetTests |
PITest Helper is compatible with Java and Kotlin projects using Maven or Gradle. At this time only configuring target classes and tests is allowed, but more options to customize the PITest command will be added soon.
The plugin is compatible with IntelliJ IDEA Community and Ultimate, from versions 2022.3 to 2024.3.
Plugin based on the IntelliJ Platform Plugin Template.