Skip to content

Commit 1a9c673

Browse files
committed
Convert subset to version
- support both at this moment Signed-off-by: renfeiw <[email protected]>
1 parent c7fd68a commit 1a9c673

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ TestKitGen (TKG) is a lightweight test harness for bringing together a diverse s
55
TKG standardizes:
66
- test target generation (generates make targets based on contents of playlist.xml files)
77
- test output, defaulting to Test Anything Protocol (TAP) as the simplest, lowest common denominator
8-
- the way tests are tagged, grouped, included and excluded (categorizing by elements in the playlist file, by group, impl, subset (version), etc)
8+
- the way tests are tagged, grouped, included and excluded (categorizing by elements in the playlist file, by group, impl, version, etc)

playlist.xsd

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@
7070
</xs:sequence>
7171
</xs:complexType>
7272
</xs:element>
73-
<xs:element name="subsets" minOccurs="0">
73+
<xs:element name="versions" minOccurs="0">
7474
<xs:complexType>
7575
<xs:sequence>
76-
<xs:element type="xs:string" name="subset" maxOccurs="unbounded"/>
76+
<xs:element type="xs:string" name="version" maxOccurs="unbounded"/>
7777
</xs:sequence>
7878
</xs:complexType>
7979
</xs:element>

scripts/testBot/playlistModifier.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def addDisabled(files, args):
8686
print(f"Could not find test case {testCaseName}_{nthVar} (i.e., the {nthVar + 1}th variation for test {testCaseName})!")
8787
sys.exit(-1)
8888
if "ver" in args:
89-
verEle = etree.Element("subset")
89+
verEle = etree.Element("version")
9090
verEle.text = args["ver"]
9191
disabled.append(verEle)
9292
if "impl" in args:

src/org/testKitGen/TestInfoParser.java

+18-10
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,21 @@ public TestInfo parse() {
5252
boolean isValidVendor = (vendors.size() == 0) || vendors.contains(arg.getVendor());
5353
if (!isValidVendor) return null;
5454

55-
// Do not generate make target if subset doesn't match the exported jdk_version
56-
List<String> subsets = new ArrayList<String>();
57-
getElements(subsets, "subsets", "subset", null, ti.getTestCaseName());
58-
boolean isValidSubset = subsets.size() == 0;
59-
for (String subset : subsets) {
60-
isValidSubset = checkJavaVersion(subset);
61-
if (isValidSubset) {
55+
// Do not generate make target if version doesn't match the exported jdk_version
56+
List<String> versions = new ArrayList<String>();
57+
getElements(versions, "versions", "version", null, ti.getTestCaseName());
58+
//TODO: remove temporarily support for old style
59+
if (versions.size() == 0) {
60+
getElements(versions, "subsets", "subset", null, ti.getTestCaseName());
61+
}
62+
boolean isValidVersion = versions.size() == 0;
63+
for (String version : versions) {
64+
isValidVersion = checkJavaVersion(version);
65+
if (isValidVersion) {
6266
break;
6367
}
6468
}
65-
if (!isValidSubset) return null;
69+
if (!isValidVersion) return null;
6670

6771
// Do not generate make target if the test is AOT not applicable when test flag
6872
// is set to AOT
@@ -189,14 +193,18 @@ private void parseDisableInfo(TestInfo ti) {
189193

190194
String impl = getDisabledEle(disabled, "impl", ti.getTestCaseName());
191195
String vendor = getDisabledEle(disabled, "vendor", ti.getTestCaseName());
192-
String subset = getDisabledEle(disabled, "subset", ti.getTestCaseName());
196+
String version = getDisabledEle(disabled, "version", ti.getTestCaseName());
197+
//TODO: remove temporarily support for old style
198+
if (version == null) {
199+
version = getDisabledEle(disabled, "subset", ti.getTestCaseName());
200+
}
193201
String plat = getDisabledEle(disabled, "plat", ti.getTestCaseName());
194202
String variation = getDisabledEle(disabled, "variation", ti.getTestCaseName());
195203

196204
for (Variation var : ti.getVars()) {
197205
if (((impl == null) || arg.getImpl().equals(impl))
198206
&& ((vendor == null) || arg.getVendor().equals(vendor))
199-
&& ((subset == null) || checkJavaVersion(subset))
207+
&& ((version == null) || checkJavaVersion(version))
200208
&& ((plat == null) || checkPlat(plat))
201209
&& ((variation == null) || var.getVariation().equals(variation))) {
202210
var.addDisabledReasons(comment);

0 commit comments

Comments
 (0)