Community
Participate
Working Groups
Build Identifier: I20110127-2034 The idea is allow the developer to run a unit test 10, 20, or 100 times. This is useful to find apparently random bugs. Reproducible: Always
That's not something we want to add in the UI. It's also unclear how it should behave if you run a suite multiple times: Stop after the first failure? Or continue? Or collect all failures? What about PDE JUnit tests? If necessary, this can be implemented either directly in your test, or as a reusable add-on to JUnit (see e.g. http://stackoverflow.com/questions/1835523/is-there-a-way-to-make-eclipse-run-a-junit-test-mulitple-times-until-failure ).
Hi, Thank you for the pointer. >Stop after the first failure? No, JUnit does not stop a test case or suite class when a method fails a test. Repeating tests should not be any different. >Or collect all failures? Yes, just like failures are collected now when running a test class or test suite.
I now see that JUnit does support this feature through the RepeatedTest test decorator. It seems more legitimate to me now to surface this JUnit (4.x) feature in the UI. public static Test suite( ) { // run the entire test suite ten times return new RepeatedTest(new TestSuite(TestGame.class), 10); }
*** Bug 499806 has been marked as a duplicate of this bug. ***
From bug 499806: Ideally, the JUnit launch configurations would have a checkbox "[ ] Repeat test N times:" and a text filed next to it allowing users to specify how many times the test should be repeated. Additionally to that one could add "[ ] Stop execution on first failure" checkbox, which can be used not only for the proposed case but also in general.