RFR: 8254129: IR Test Framework to support regex-based matching on the IR in JTreg compiler tests [v7]

Christian Hagedorn chagedorn at openjdk.java.net
Mon May 3 17:42:53 UTC 2021


On Mon, 3 May 2021 17:34:30 GMT, Christian Hagedorn <chagedorn at openjdk.org> wrote:

>> test/lib/jdk/test/lib/hotspot/ir_framework/TestFramework.java line 984:
>> 
>>> 982:     private final String hotspotPidFileName;
>>> 983: 
>>> 984:     JVMOutput(OutputAnalyzer oa, Scenario scenario, ProcessBuilder process) {
>> 
>> instead of passing a ProcessBuilder, you can either pass a command-line or better just past prepared flags, and make it JVMOutput's (you will need a better name) responsibility for executing the process, creating OutputAnalyzer, etc. 
>> 
>> Suggestion:
>> 
>>     JVMOutput(List<String> cmds, Scenario scenario) {
>>         var pb = ProcessTools.createJavaProcessBuilder(cmds);
>>         try {
>>             // Calls 'main' of TestFrameworkExecution to run all specified tests with commands 'cmds'.
>>             // Use executeProcess instead of executeTestJvm as we have already added the JTreg VM and
>>             // Java options in prepareTestVMFlags().
>>             this.oa = ProcessTools.executeProcess(process);
>>         } catch (Exception e) {
>>             throw new TestFrameworkException("Error while executing Test VM", e);
>>         }
>>         this.cmd = pb.command();
>>         ...
>> 
>> 
>> and then runTest will be smth like
>> 
>>     private void runTestVM(List<String> additionalFlags) {
>>           List<String> cmds = prepareTestVMFlags(additionalFlags);
>>           socket.start();
>>           JVMOutput output = new JVMOutput(cmds, scenario);
>>           ...
>
> I did a refactoring and introduced new classes `FlagVMProcess` and `TestVMProcess`. I also did a renaming of `TestFrameworkPrepareFlags` -> `FlagVM` and `TestFrameworkExecution` -> `TestVM` to make it more clear whats going on.

I did a refactoring and introduced new classes `FlagVMProcess` and `TestVMProcess`. I also did a renaming of `TestFrameworkPrepareFlags` -> `FlagVM` and `TestFrameworkExecution` -> `TestVM` to make it more clear whats going on.

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

PR: https://git.openjdk.java.net/jdk/pull/3508


More information about the hotspot-compiler-dev mailing list