No test library found on classpath. PIT requires either JUnit 4 (but can run JUnit 3 tests) or TestNG

339 views
Skip to first unread message

O G

unread,
May 8, 2017, 2:13:32 PM5/8/17
to PIT Users
Hello,
I'm a new user of pitest and i want to run it using the command line on Linux (Ubuntu).
I found a lot of posts on this topic but couldn't get the solution.
I'll be glad if you could tell me what is wrong with my command (just copy paste it and it will like fine):
java -cp \
./pitest-entry-1.2.0.jar:\
./pitest-ant-1.2.0.jar:\
./pitest-1.2.0.jar:\
./pitest-command-line-1.2.0.jar:\
~/.m2/repository/junit/junit/4.12/junit-4.12.jar:\
\
org.pitest.mutationtest.commandline.MutationCoverageReport \
\
--reportDir . \
--targetClasses il.ac.technion.cs.smarthouse.system \
--targetTests il.ac.technion.cs.smarthouse.system \
--sourceDirs ~/repos/Smartcity-Smarthouse/src \



I'm getting the following output:
Exception in thread "main" org.pitest.help.PitHelpError: No test library found on classpath. PIT requires either JUnit 4 (but can run JUnit 3 tests) or TestNG
See http://pitest.org for more details.
at org.pitest.mutationtest.config.ConfigurationFactory.createConfiguration(ConfigurationFactory.java:58)
at org.pitest.mutationtest.config.LegacyTestFrameworkPlugin.createTestFrameworkConfiguration(LegacyTestFrameworkPlugin.java:38)
at org.pitest.mutationtest.config.SettingsFactory.getTestFrameworkPlugin(SettingsFactory.java:133)
at org.pitest.mutationtest.config.SettingsFactory.createCoverageOptions(SettingsFactory.java:142)
at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:80)
at org.pitest.mutationtest.tooling.EntryPoint.execute(EntryPoint.java:45)
at org.pitest.mutationtest.commandline.MutationCoverageReport.runReport(MutationCoverageReport.java:87)
at org.pitest.mutationtest.commandline.MutationCoverageReport.main(MutationCoverageReport.java:45)


But I have junit 4.12 in my classpath... so what is the problem?
also, do i need to put also pitest-entry-1.2.0.jar and pitest-ant-1.2.0.jar: in the classpath?

Thanks a lot.

Yushan Zhang

unread,
May 10, 2017, 12:02:13 AM5/10/17
to PIT Users

I had a similar error before but I'm using PIT with Eclipse. It seems you don't have a correct reference to pitest-1.2.0.jar, you may check the class path on your project settings.

O G

unread,
May 10, 2017, 1:14:23 AM5/10/17
to PIT Users
Thanks, but as you can see, im using the command line to run pitest.
Reply all
Reply to author
Forward
0 new messages