Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run Pitest from the command line

According to Pitest's documentation, it seems that this should be simple, but it is giving me some trouble. I should be able to have

java -cp <your classpath> \
     org.pitest.mutationtest.commandline.MutationCoverageReport \
    --reportDir c:\\mutationReports \
    --targetClasses example.foo.* \
    --sourceDirs c:\\myProject\\src \
    --targetTests example.foo*

but I don't know what some of those things should be for my project, such as "<your classpath>".

My project's file structure looks like this:

enter image description here

Ultimately I want to put this in a .bat file and run it on TeamCity for my CI

Any help would be appreciated!

like image 825
DeadEli Avatar asked Feb 18 '15 05:02

DeadEli


People also ask

What is Pitest?

PIT is a state of the art mutation testing system, providing gold standard test coverage for Java and the jvm. It's fast, scalable and integrates with modern test and build tooling. Get Started.

What is mutation coverage?

5. Mutation Coverage. Mutation testing is a testing technique used to improve the adequacy of tests and identify defects in code. The idea is to change the production code dynamically and cause the tests to fail.


1 Answers

The command line parameter should cover every single jar you would need to build your project (when making the project inside an IDE it should provide a classpath for you that you can use in command line).

like image 122
borowis Avatar answered Oct 10 '22 14:10

borowis