How do the Test types execute?


we have a custom junit4 runner class that works fine in ant, but when I’m testing it from gradle, I’m running into issues. I’ve tried browsing the gradle source code to understand how it fits together, but I can’t get my head around it, so if anyone involved in that implementation could briefly explain the design or post links to some documentation, that would be greatly appreciated.
I’ve looked at subprojects/testing-jvm/src/main/java/org/gradle/api/internal/tasks/testing/junit/, but I don’t really know how that is called from the rest of the code so I’m lost.

My problem is that our junit runner has a feature that can verify that the test does not print anything on stdout/stderr. When I run this under gradle, the junit runner will see the printouts from the runner (which lists how many tests have run, succeeded etc) as stdout and fail. It seems to be asserting both on the test output and the output from the runner itself, which is strange.
I suspect that this has to do with the local/remote split of the runners in gradle, but for this behavior to happen, then it basically has to be so that the custom runner is instantiated both locally and remote if a runner of this class is actually receiving output that can only have been created by the same custom runner.

Anyone out there that understands how the runners are instantiated from gradle’s Test task?