RFR: 8324966: Allow selecting jtreg test case by ID

Erik Joelsson erikj at openjdk.org
Mon Jul 1 07:06:26 UTC 2024


On Mon, 1 Jul 2024 06:49:15 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> [JDK-8287828](https://bugs.openjdk.org/browse/JDK-8287828) added support for selecting specific JTREG tests cases by their ID. However because of how we handle input strings in make it was not possible to use `#` anywhere, breaking this feature.
> 
> Prior to this change
>  * `TEST="gc/TestSystemGC.java#Serial gc/TestSystemGC.java#G1" make test` Works.
>  * `make test TEST="gc/TestSystemGC.java#Serial gc/TestSystemGC.java#G1"` Does not work.
> 
> After this change both works.
> 
> When propagating command line variables through the make system we transiently replaced spaces with `#` (which drops any actual `#` when restoring the spaces). This patch replaced the `#` character with `§` under the assumption that it will not be used in these arguments.
> 
> This works for now. An alternative would be to make this more robust by selecting a sequence of characters that is checked to not be part of the strings in question as the space placeholder. But I will leave that to our more advance Make engineers to handle.

I think this is a good enough solution for now. Picking a character that won't interfere with anything is tricky, and I would be surprised if we aren't bitten again by using `§` at some point in the future, but at least I can't think of a usecase for that character right now. As you say, using a sequence of characters would probably be better, but we can save that for later when someone has time to really dig into it.

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

Marked as reviewed by erikj (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/19963#pullrequestreview-2150582280


More information about the build-dev mailing list