The @requires feature doesn't support tests with multiple @run lines that have different requirements.
One use-case for this is a test that is relevant to more than one but not all of the supported garbage collectors. For example, I have a test that needs to be run with either G1 or CMS as the collector. However, there isn't a way to write the @requires constraint such that I could have two @run lines, one for each of those collectors.
A @requires constraint of
@requires vm.gc == "G1" | vm.gc == "ConcMarkSweep" | vm.gc == "null"
doesn't work, because if (for example) G1 is specified externally, that will conflict with the CMS collector specification for one of the @run lines.
Alternatively, a @requires constraint of
@requires vm.gc == "null"
won't run the G1 test when G1 is specified externally.
A workaround is to have multiple copies of the test, each with its own (singleton) @run line and corresponding @requires constraint. For all but the most trivial of tests this probably involves introducing script wrappers for those test variants, in order to avoid maintenance cost on multiple copies of the test program.
One use-case for this is a test that is relevant to more than one but not all of the supported garbage collectors. For example, I have a test that needs to be run with either G1 or CMS as the collector. However, there isn't a way to write the @requires constraint such that I could have two @run lines, one for each of those collectors.
A @requires constraint of
@requires vm.gc == "G1" | vm.gc == "ConcMarkSweep" | vm.gc == "null"
doesn't work, because if (for example) G1 is specified externally, that will conflict with the CMS collector specification for one of the @run lines.
Alternatively, a @requires constraint of
@requires vm.gc == "null"
won't run the G1 test when G1 is specified externally.
A workaround is to have multiple copies of the test, each with its own (singleton) @run line and corresponding @requires constraint. For all but the most trivial of tests this probably involves introducing script wrappers for those test variants, in order to avoid maintenance cost on multiple copies of the test program.