Skip to content

How to execute custom test cases or specified test cases rather than all tests on gitbug-java? #46

@cc32

Description

@cc32

I am going to evaluate my own fault localization approach on GitBug-Java. To do this, I need to do the following steps:

  1. Inject extra test cases into the test suite.
  2. Compile the project.
  3. Execute the tests.

I tried like this:

  1. I checked out one of the bugs and modified one of the .java Files of the Test Classes. It looks like this:
public class Gt06ProtocolDecoderTest extends ProtocolTest {

    @Test
    public void tryTestInjection() throws Exception {
        int a=1;
        int b=0;
        assertEquals(a,b);     // This is the custom test case, and it always fails.
    }

    @Test
    public void testDecode() throws Exception {
      ...   // This is the original Failed Test Case
    }
}
  1. I execute gitbug-java run checkout --act-cache=act-cache and get:
Expected executed tests: 479
Executed tests: 480
Passing tests: 478
Skipped tests: 23
Failing tests: 2
Failed tests:
- org.traccar.protocol.Gt06ProtocolDecoderTest#tryTestInjectsion()
- org.traccar.protocol.Gt06ProtocolDecoderTest#testDecode()

It turns out that my custom test case is compiled and executed. But to speed up, is it possible to execute single test case rather than all tests?
How can I do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions