Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support multiple required in features tag #614

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, if there is no test flag and feature match, the test will run. This is not expected behavior.
Grinder - test run with TEST_FLAG=empty.

}
} 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