Skip to content

Commit

Permalink
Merge pull request #614 from annaibm/testflag
Browse files Browse the repository at this point in the history
Support multiple required in features tag
  • Loading branch information
LongyuZhang authored Sep 26, 2024
2 parents e855b81 + 8733901 commit d28073b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions scripts/testTKG/test_platformRequirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ def run_test():
skipped.add('test_not_arch_390_0')
else:
passed.add('test_not_arch_390_0')
passed.add('test_not_arch_390_z15plus_0')

if 'test_arch_390_z15_0' not in passed:
skipped.add('test_arch_390_z15_0')
Expand Down
12 changes: 9 additions & 3 deletions src/org/testKitGen/TestInfoParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,15 @@ public TestInfo parse() {
ti.addFeature(featElements[0].toLowerCase(), featElements[1].toLowerCase());
}
Set<String> testFlags = new HashSet<>(arg.getTestFlag());
boolean requiredFeatureFound = false;
boolean hasRequiredFeature = false;
for (Map.Entry<String,String> entry : ti.getFeatures().entrySet()) {
String featureOpt = entry.getValue().toLowerCase();
if (featureOpt.equals("required")) {
if (!isFeatureInTestFlags(testFlags, entry.getKey())) {
return null;
hasRequiredFeature = true;
if (isFeatureInTestFlags(testFlags, entry.getKey())) {
requiredFeatureFound = true;
break;
}
} else if (featureOpt.equals("nonapplicable")) {
// Do not generate make target if the test is not applicable for one feature defined in TEST_FLAG
Expand All @@ -106,7 +110,9 @@ public TestInfo parse() {
System.exit(1);
}
}

if (hasRequiredFeature && !requiredFeatureFound) {
return null;
}
if (testFlags.contains("aot")) {
for (Map.Entry<String,String> entry : ti.getFeatures().entrySet()) {
if (doesFeatureMatchTestFlag("aot", entry.getKey())) {
Expand Down

0 comments on commit d28073b

Please sign in to comment.