-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add per-jdk version configuration support
- Loading branch information
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package args | ||
|
||
import "testing" | ||
|
||
func TestParsingJvmVersion(t *testing.T) { | ||
testCases := []struct { | ||
output string | ||
expectedVersion string | ||
}{ | ||
{ | ||
output: "openjdk version \"24-ea\" 2025-03-18\nOpenJDK Runtime Environment (build 24-ea+24-2960)\nOpenJDK 64-Bit Server VM (build 24-ea+24-2960, mixed mode, sharing)", | ||
expectedVersion: "24-ea", | ||
}, | ||
{ | ||
output: "openjdk version \"23\" 2024-09-17\nOpenJDK Runtime Environment Temurin-23+37 (build 23+37)\nOpenJDK 64-Bit Server VM Temurin-23+37 (build 23+37, mixed mode, sharing)", | ||
expectedVersion: "23", | ||
}, | ||
} | ||
|
||
for _, testCase := range testCases { | ||
actualVersion, err := ExtractJvmVersion(testCase.output) | ||
if err != nil { | ||
t.Fatalf("Unexpected error while extracting JVM version: %v", err) | ||
} | ||
if actualVersion != testCase.expectedVersion { | ||
t.Fatalf("Expected Java version %s for output %s", testCase.expectedVersion, testCase.output) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package args | ||
|
||
const vectorApiIncubating = "--add-modules=jdk.incubator.vector" | ||
|
||
var jvmSpecificConfig = map[string][]string{ | ||
"22": {vectorApiIncubating}, | ||
"23": {vectorApiIncubating}, | ||
// 24 is not released yet, but vector API will be still incubating | ||
"24": {vectorApiIncubating}, | ||
} |