hcoles / pitest

State of the art mutation testing system for the JVM
Apache License 2.0
1.7k stars 357 forks source link

Pitest ignores source classes annotated with JUnit annotations? #381

Open skapral opened 7 years ago

skapral commented 7 years ago

Faced this issue here: https://github.com/project-avral/oo-atom/tree/master/atom-tests

One of my source classes is annotated with @RunWith annotation. However, pitest doesn't do a mutation for it and doesn't even count its coverage. I assume that it is because of JUnit annotation on the class. How can I disable such behavior and force pitest to do coverage and mutation for all my non-test classes?

hcoles commented 7 years ago

Yes, pitest currently splits classes into finds into "tests" and "code" buckets and does not mutate the tests.

This isn't really necessary most of the time as build tools don't pass it a mixed classpath - but this was baked in back in the early days of development.

It needs looking at but unfortunately some functionality (e.g support for junit categories) has been piggy backed onto it so it's not simple to fix.

Co-incidentally I was looking at this last night as part of a larger change.