-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run-vmtest: change allow/denylist handling
Showing
6 changed files
with
909 additions
and
133 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,39 @@ | ||
#!/usr/bin/python3 | ||
|
||
import sys | ||
|
||
def clean_line(line: str) -> str: | ||
line = line.split('#')[0] # remove comment | ||
line = line.strip() # strip whitespace | ||
return line | ||
|
||
def read_clean_and_sort_input() -> list[str]: | ||
input = [] | ||
for line in sys.stdin: | ||
line = clean_line(line) | ||
if len(line) == 0: | ||
continue | ||
input.append(line) | ||
input.sort() | ||
return input | ||
|
||
def dedup_subtests(lines: list[str]): | ||
i = 0 | ||
j = 1 | ||
while j < len(lines): | ||
l1 = lines[i] | ||
l2 = lines[j] | ||
if l1 == l2 or ('/' not in l1) and ('/' in l2) and l2.startswith(l1): | ||
# print(f"removing '{l2}' because '{l1}' is in the list") | ||
lines.remove(l2) | ||
else: | ||
i += 1 | ||
j += 1 | ||
|
||
if __name__ == '__main__': | ||
lines = read_clean_and_sort_input() | ||
dedup_subtests(lines) | ||
for line in lines: | ||
print(line) | ||
|
||
|
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