Integrated: 7903981: Support easy way to use current class name for test actions
Christian Stein
cstein at openjdk.org
Thu Apr 24 10:26:06 UTC 2025
On Fri, 4 Apr 2025 09:56:16 GMT, Christian Stein <cstein at openjdk.org> wrote:
> Please review this change to allow an easier way to use current class name for test actions.
>
> Test authors usually specify the name of a test class to be run by `jtreg` 1:1 in a `@run` action directive. This PR introduces the new test property `test.main.class` and tries to initialize it with the fully-qualified class name of the test class. It is composed of the package name and the truncated file name of `.java` source file passed to `jtreg`: `SomeTest.java` becomes `SomeTest`
>
> Example for `Test.java` in the unnamed package:
> - `@run main Test` - `@run main ${test.main.class}`
>
> Example for `Test.java` declaring `package p;`:
> - `@run main p.Test` - `@run main ${test.main.class}`
>
> See also: [CODETOOLS-7902352: Support use of ${property.name} in action args](https://bugs.openjdk.org/browse/CODETOOLS-7902352)
This pull request has now been integrated.
Changeset: 4cab4298
Author: Christian Stein <cstein at openjdk.org>
URL: https://git.openjdk.org/jtreg/commit/4cab4298030aa7e9eebf92737815fa727f9b2fda
Stats: 164 lines in 8 files changed: 146 ins; 2 del; 16 mod
7903981: Support easy way to use current class name for test actions
Reviewed-by: lmesnik, rriggs, jlahoda
-------------
PR: https://git.openjdk.org/jtreg/pull/257
More information about the jtreg-dev
mailing list