Just yesterday I resolved long standing PDE Bug 351396 [1] and ignore 'test'-fragments when adding requirements to a Eclipse/Equinox launch.
The check to identify 'test'-fragments is based on the classpath's test-attribute because it seems to be the most reliable indication for it and there is actually no precise specification for something as 'test-fragment', as it has been already said. At least it is more precise than just a naming convention.
Test-Fragments should not be part of a launched Eclipse/Equinox application, unless it is a Plug-in test contained in that test-fragment, because they can pollute or even break the application with their contributed test-resources. Examples would be extra extensions to Extension-Points that already caused some pain for me.
This work is part of the greater goal to simplify the creation of Eclipse products that can be launched in the IDE by automatically adding dependencies as suggested in Bug 570760 respectively to fix feature-based launches in this regard that already automatically add requirements. This involes a few more bugs, but the mentioned one is the 'top' of them.
An alternative solution to avoid unintended inclusion of test-fragments would be to not add fragments at all when adding requirements to a launch.
> >Also I'm not sure PDE adds something to metadata to enforce this warning.
> It has some operations that do set the flag according to the bundle name, but maybe not automatically, could be on import.
At the moment ClasspathComputer
.updateTestAttribute() adds the classpath test-attribute automatically. IIRC this method is called when a new plugin projects are created
whose name ends with .test(s). [3]
> So I have no other choice that setting this flag in LSP4E or I cannot develop. It's interrupting my workflow and I do not see any value to compensate this interruption; and luckily I know deeply all those projects to easily find how to remediate, I can imagine some people who are less aware of those things get lost.
I'm not sure if this would be a good idea, but I already wondered if it would be useful to add a warning if a plug-in projects ends with name .test(s) but has no test-attribute on its classpath.
The intention was more to replace the weak naming convention with the IMHO stronger attribute but it could also help in this regard (if your test projects comply with the naming convention).