Skip to content
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
5 changes: 4 additions & 1 deletion run-vmtest/normalize_bpf_test_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ def next_test(lines: list[str]):
prev = lines[0]

def is_subtest(line: str) -> bool:
return ('/' in line) and ('/' not in prev) and line.startswith(prev)
# Compare against "prev/" rather than "prev": without the separator
# "a_test" also swallows "a_test_two/subtest", which is a subtest of a
# different test that happens to share a prefix.
return ('/' not in prev) and line.startswith(prev + '/')

yield lines[0]
for line in lines[1:]:
Expand Down
2 changes: 2 additions & 0 deletions run-vmtest/tests/normalize_bpf_test_names/expected-output.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ test4_blah
test5
test6
test7/subtest123
test8
test8_peek/subtest1
2 changes: 2 additions & 0 deletions run-vmtest/tests/normalize_bpf_test_names/input.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ test5 # should consume test5/s
## some blank lines, should be removed


test8
test8_peek/subtest1 # must be kept: test8_peek is a different test, not a subtest of test8
Loading