defects4j icon indicating copy to clipboard operation
defects4j copied to clipboard

Does Defects4j Supports generated test suite using Junit5?

Open jmueducn opened this issue 1 year ago • 1 comments

I use command like defects4j test -s xxxxx.tar.bz2 which contains my generated test.

If Junit5 is not supported, is there any ways to make it happen? Like configuring the defects4j/framework/projects/defects4j.build.xml (to add a task or something)( I already configure it to add classpath and jar package of my JUNIT5 to make it compilable, but still not runnable probably because ant does not have a Junit5 task? or I might get something wrong here) But I don't know whether it is possible. Or I can only run test classes with Junit4.(And that's OK for me,too.)

jmueducn avatar Jan 02 '25 09:01 jmueducn

Hi @jmueducn,

We are in the process of changing the test command to directly invoke the JUnit5 console launcher under the hood. This will allow you to run defects4j test -s with Junit4 or JUnit5 test suites.

Until this features lands, there are two options:

  1. Generate JUnit4 tests and call defects4j test -s.
  2. Generate JUnit5 tests, call defects4j export to obtain classpath information, and then directly call the JUnit5 console launcher.

Best, René

rjust avatar Oct 01 '25 08:10 rjust