RFR: 7903981: Support easy way to use current class name for test actions [v4]

Christian Stein cstein at openjdk.org
Tue Apr 8 06:55:29 UTC 2025


> 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 and the first type name (`class`,`interface`,`enum`,`record`) found in the `.java` source file passed to `jtreg`.
> 
> Examples:
> - `@run main Test` - `@run main ${test.main.class}`
> - `@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)

Christian Stein has updated the pull request incrementally with one additional commit since the last revision:

  Base main entry-point name computation on file name

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

Changes:
  - all: https://git.openjdk.org/jtreg/pull/257/files
  - new: https://git.openjdk.org/jtreg/pull/257/files/fe717e2f..f7dc697e

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jtreg&pr=257&range=03
 - incr: https://webrevs.openjdk.org/?repo=jtreg&pr=257&range=02-03

  Stats: 18 lines in 1 file changed: 6 ins; 6 del; 6 mod
  Patch: https://git.openjdk.org/jtreg/pull/257.diff
  Fetch: git fetch https://git.openjdk.org/jtreg.git pull/257/head:pull/257

PR: https://git.openjdk.org/jtreg/pull/257


More information about the jtreg-dev mailing list