«« Software Engineering and Feedback Smaller Companies, More Hats »»
blog header image
Eclipse: How to Run All Tests in Multiple Projects?

Here's a question to the Planet Eclipse audience...

I have 23 Eclipse projects (most of them plugin projects) for one product. Is it possible to run all of the JUnit Test Cases in those projects at once in Eclipse? In the run configuration all I can see is the option to run either a single Test Case or all of the Test Cases in a single project.

I suppose I could maintain a giant JUnit Test Suite class but I'd rather not have it span projects. My fallback right now is to run my product Ant build script and read the JUnit report with the consolidated results of all projects. The downside is that Ant test running is not integrated into Eclipse's test runner view so it is more mouse clicks to see the test results.

How have other people worked around this?

Maybe a good enhancement would be to run all JUnit Test Cases in a working set.

Posted at March 30, 2005 at 05:31 PM EST
Last updated March 30, 2005 at 05:31 PM EST

For each of your projects do they have a "AllTests" class? If you wanted to run all the tests you could just have it run those. You would only have to change it if you added / removed a project.

I like your idea of being able to run all tests in a working set (based on a pattern).

Does that make sense? I'm sick with a cold so I don't know if I'm being clear or not. Here, let's draw it out.

+-AllTestSuite (proj A)
  +-Tests in proj A
+-AllTestSuite (proj B)
  +-Tests in proj B
+-AllTestSuite (proj C)

» Posted by: Jim at March 30, 2005 06:25 PM

Yeah, I could maintain Test Suites like that but I'd rather not have to... if I add more Test Cases I'd like them to be picked up automagically if they are already in the working set.

Besides, having it based on working sets makes them more dynamic.

» Posted by: Ryan at March 30, 2005 07:37 PM

Another way is to use TestNG + its Eclipse plug-in, which lets you invoke as many testng.xml as you want in a launch configuration...


» Posted by: Cedric at March 31, 2005 10:07 AM

But then I have to maintain test.xml files? Or annotations? Or...

... I don't want to have to maintain a list of anything. I just want to run all of the Test Cases in an arbitrary working set.

» Posted by: Ryan at March 31, 2005 06:49 PM
Search scope: Web ryanlowe.ca