RFR: 8365262: [IR-Framework] Add simple way to add cross-product of flags [v2]

Emanuel Peter epeter at openjdk.org
Wed Aug 20 13:29:38 UTC 2025


On Mon, 18 Aug 2025 08:12:02 GMT, Manuel Hässig <mhaessig at openjdk.org> wrote:

>> This PR adds the `TestFramework::addCrossProductScenarios` method to enable more ergonomic testing of the combination of all flag combinations. To illustrate its use, I also converted one test to use the new cross product functionality.
>> 
>> Testing:
>>  - [x] Github Actions
>>  - [x] tier1,tier2 plus some internal testing on Oracle supported platforms
>
> Manuel Hässig has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Apply Benoît's suggestion
>   
>   Co-authored-by: Benoît Maillard <benoit.maillard at protonmail.com>

test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java line 75:

> 73:                                         Set.of("-XX:+UseNewCode", "-XX:-UseNewCode"));
> 74:             t3.start();
> 75:             Asserts.fail("Should have thrown exception");

Can I also do a Power-Set? We could do that with an empty string or null.
Can an entry also be multiple flags? Sometimes you need them in pairs.

Would be nice to have tests for that ;)

test/hotspot/jtreg/testlibrary_tests/ir_framework/tests/TestScenariosCrossProduct.java line 77:

> 75:             Asserts.fail("Should have thrown exception");
> 76:         } catch (TestRunException e) {
> 77:             if (!e.getMessage().contains("The following scenarios have failed: #0, #1, #2, #3")) {

What if the string continued with `, #4`? Can we ensure this does not happen?

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/26762#discussion_r2288166282
PR Review Comment: https://git.openjdk.org/jdk/pull/26762#discussion_r2288172600


More information about the hotspot-compiler-dev mailing list