RFR: JDK-8075586: add @modules as needed to the open hotspot tests
Alan Bateman
Alan.Bateman at oracle.com
Fri Mar 20 13:20:17 UTC 2015
On 20/03/2015 12:16, Alexander Kulyakhtin wrote:
> Hi,
>
> Could you, please, review the fix below.
>
> CR: https://bugs.openjdk.java.net/browse/JDK-8075586
> webrev: http://cr.openjdk.java.net/~tpivovarova/akulyakh/8075586/webrev.00/
>
> The fix adds @modules keyword to the existing hotspot tests, as needed, so that the tests can access the required API when the new modular architecture is in place.
>
> Best regards,
> Alex
Thanks Alex. Moving this thread from serviceability-dev to hotspot-dev
as this patch covers all areas.
Just to put more context on this patch and similar patches that will be
proposed for tests in other repos. The new @modules tag can be used for
test selection (e.g. no point running a test that make use of types in
module java.management if the runtime under test does not have the
management module), and additionally to declare a dependency on
JDK-internal APIs. If my test uses sun.misc.Unsafe for example then the
runtime under test needs to export that API for the test to compile and
run. Clearly the latter requires the module system in JDK 9 so consider
this part as just preparing the tests for when that day comes.
One other thing to say to say is that Alex has tooling to examine the
test tree and create or change the @modules tag as needed. The intention
is that this should run periodically to refresh the @modules tags. In
this period before the module system then we can't expect everyone that
is adding or changing tests to have internalized the module graph [1]
and furthermore know which APIs are exported or not. In other words, the
intention is not to needlessly burden anyone that adds or changes tests.
Clearly making use of a new jtreg tag means everyone with a local copy
of jtreg should grab a recent build.
Finally, I hope in time that the TEST.groups files can be cleaned up to
remove the needs_* groups, this is important for the group definitions
in the jdk repo mostly (but there are some in the hotspot TEST.groups too).
-Alan
[1] http://openjdk.java.net/jeps/200
More information about the hotspot-dev
mailing list