Merge test plugins into their corresponding non-test plugins
Tycho used to require that all test code was in a separate plugin (e.g. for a plugin x
it was in x.tests
). As of Tycho 2.4 it is possible to put the code and tests into a single plugin. The tests can be placed into a src-test
folder that is then configured to be a test folder. These sources are only used for testing and don't become part of the plugin JAR.
There are several benefits to this:
- There will be less plugins.
- The test code is closer to the code being tested.
- The code plugin doesn't need to export things just so that the test plugin can access it.
Note that there are naming conventions for tests to be executed by Maven and tests to be executed by Tycho. The former will execute as plan Java tests. Only the latter will be executed in a headless Eclipse environment, which is required for at least our ToolDef-based tests, and perhaps more of them. Now all tests are executed by Tycho in a headless Eclipse environment.
Furthermore, Tycho 2.4 also supports adding the 'JUnit Classpath Container' to the classpath of the plugin. It is then no longer needed to add JUnit explicitly to the manifest as a required bundle. We may consider this as well.
See also:
- https://github.com/eclipse/tycho/blob/master/RELEASE_NOTES.md#240 (Tycho 2.4 release notes)