|
159 | 159 | <excludeFromFailureFile>pmd-exclude.properties</excludeFromFailureFile> |
160 | 160 | </configuration> |
161 | 161 | </plugin> |
162 | | - |
163 | | - <plugin> <!-- PIT Mutation Testing Plugin --> |
164 | | - <groupId>org.pitest</groupId> |
165 | | - <artifactId>pitest-maven</artifactId> |
166 | | - <version>1.20.2</version> |
167 | | - <dependencies> |
168 | | - <dependency> |
169 | | - <groupId>org.pitest</groupId> |
170 | | - <artifactId>pitest-junit5-plugin</artifactId> |
171 | | - <version>1.2.3</version> |
172 | | - </dependency> |
173 | | - </dependencies> |
174 | | - <configuration> |
175 | | - <targetClasses> <!-- Classes to mutate --> |
176 | | - <param>com.thealgorithms.*</param> |
177 | | - </targetClasses> |
178 | | - <excludedClasses> |
179 | | - <param>com.thealgorithms.*Test</param> |
180 | | - </excludedClasses> |
181 | | - <targetTests> <!-- Test classes to run --> |
182 | | - <param>com.thealgorithms.*Test</param> |
183 | | - </targetTests> |
184 | | - <mutators> <!-- Mutation operators to use --> |
185 | | - <mutator>DEFAULTS</mutator> |
186 | | - </mutators> |
187 | | - <threads>4</threads> <!-- Number of threads --> |
188 | | - <outputFormats> |
189 | | - <param>HTML</param> |
190 | | - <param>XML</param> |
191 | | - </outputFormats> |
192 | | - <verbose>true</verbose> <!-- Verbose reporting for education --> |
193 | | - <timeoutConstant>4000</timeoutConstant> <!-- Timeout in milliseconds --> |
194 | | - <jvmArgs> <!-- Memory in MB --> |
195 | | - <jvmArg>-Xmx1024m</jvmArg> |
196 | | - </jvmArgs> |
197 | | - <skipFailingTests>true</skipFailingTests> <!-- Skip failing tests --> |
198 | | - </configuration> |
199 | | - <executions> |
200 | | - <execution> |
201 | | - <id>pitest</id> |
202 | | - <phase>test</phase> |
203 | | - <goals> |
204 | | - <goal>mutationCoverage</goal> |
205 | | - </goals> |
206 | | - </execution> |
207 | | - </executions> |
208 | | - </plugin> |
209 | 162 | </plugins> |
210 | 163 | </build> |
| 164 | + |
| 165 | + <profiles> |
| 166 | + <profile> <!-- Use with `mvn clean test -Pdev` to generate PIT coverage reports for your tests --> |
| 167 | + <id>dev</id> |
| 168 | + |
| 169 | + <properties> <!-- Change these to select target --> |
| 170 | + <modulename>datastructures</modulename> |
| 171 | + <packagename>trees</packagename> |
| 172 | + <classname>AVLSimple</classname> |
| 173 | + </properties> |
| 174 | + |
| 175 | + <build> |
| 176 | + <plugins> |
| 177 | + <plugin> <!-- Surefire --> |
| 178 | + <artifactId>maven-surefire-plugin</artifactId> |
| 179 | + <configuration> |
| 180 | + <includes> |
| 181 | + <include>com/thealgorithms/${modulename}/${packagename}/${classname}Test.java</include> |
| 182 | + </includes> |
| 183 | + </configuration> |
| 184 | + </plugin> |
| 185 | + |
| 186 | + <plugin> <!-- PIT Mutation Testing Plugin --> |
| 187 | + <groupId>org.pitest</groupId> |
| 188 | + <artifactId>pitest-maven</artifactId> |
| 189 | + <version>1.21.0</version> |
| 190 | + <dependencies> |
| 191 | + <dependency> |
| 192 | + <groupId>org.pitest</groupId> |
| 193 | + <artifactId>pitest-junit5-plugin</artifactId> |
| 194 | + <version>1.2.3</version> |
| 195 | + </dependency> |
| 196 | + </dependencies> |
| 197 | + <configuration> |
| 198 | + <!-- Classes to mutate --> |
| 199 | + <targetClasses>com.thealgorithms.${modulename}.${packagename}.${classname}*</targetClasses> |
| 200 | + <!-- Test classes to run --> |
| 201 | + <targetTests>com.thealgorithms.${modulename}.${packagename}.${classname}Test</targetTests> |
| 202 | + <mutators> <!-- Mutation operators to use --> |
| 203 | + <mutator>DEFAULTS</mutator> |
| 204 | + </mutators> |
| 205 | + <threads>2</threads> <!-- Number of threads --> |
| 206 | + <outputFormats> |
| 207 | + <param>HTML</param> |
| 208 | + <param>XML</param> |
| 209 | + </outputFormats> |
| 210 | + <timeoutConstant>4000</timeoutConstant> <!-- Timeout in milliseconds --> |
| 211 | + <jvmArgs> <!-- RAM in MB per thread --> |
| 212 | + <jvmArg>-Xmx2048m</jvmArg> |
| 213 | + </jvmArgs> |
| 214 | + <!-- Skip failing tests so whole suite will run - good for development--> |
| 215 | + <skipFailingTests>true</skipFailingTests> |
| 216 | + </configuration> |
| 217 | + <executions> |
| 218 | + <execution> |
| 219 | + <id>run-pitest</id> |
| 220 | + <phase>test</phase> <!-- bind to test-phase --> |
| 221 | + <goals> |
| 222 | + <goal>mutationCoverage</goal> |
| 223 | + </goals> |
| 224 | + </execution> |
| 225 | + </executions> |
| 226 | + </plugin> |
| 227 | + </plugins> |
| 228 | + </build> |
| 229 | + </profile> |
| 230 | + </profiles> |
211 | 231 | </project> |
0 commit comments