Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7903975

Expose @requires properties to test cases

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • tools
    • None

      Certain parts of the test code would like to use key/value pairs whose keys are pre-defined in the JDK testsuite and values are computed by a testsuite specific class, before jtreg launches the tests (i.e., the properties computed here: https://github.com/openjdk/jdk/blob/d68775d7118c926cacb7e9e4c02b85bdb0705521/test/hotspot/jtreg/TEST.ROOT#L41-L99 )

      These set of key/value pairs are currently used by jtreg in the evaluation of the @requires tag of the test definition. The proposal is to make available that same key/value pairs to the test code itself (when the test is launched) so that they can do additional decisions based on those properties.

      The key/value pairs are computed computed by https://github.com/openjdk/jtreg/blob/6a611a34bb735df082547e261d4d121267f564ac/src/share/classes/com/sun/javatest/regtest/config/RegressionContext.java#L41 . Since tests are not expected to rely on jtreg classes/types, the way to expose that detail would be by persisting the key/value pairs to a properties file ( https://docs.oracle.com/en/java/javase/23/docs//api/java.base/java/util/Properties.html#store(java.io.Writer,java.lang.String) ) whose path is then passed along to the test as a standard jtreg system property like the ones noted in https://openjdk.org/jtreg/tag-spec.html#testvars.

      ==========
      Note: See JDK-8352107 for an example of how such properties can be used by test cases

            Unassigned Unassigned
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: