[lldb][test] Remove duplicate testcase names in API test-suite (#97043)
In one of my recent PRs I mistakenly had two test-cases with the same
name, preventing one of them to run. Since it's an easy mistake to make
(e.g., copy pasting existing test-cases), I ran following sanity-check
script over `lldb/test/API`, which found couple of tests which were
losing coverage because of this (or in some cases simply had duplicate
tests):
```
import ast
import sys
filename = sys.argv[1]
print(f'Checking {filename}...')
tree = ast.parse(open(filename, 'r').read())
for node in ast.walk(tree):
if not isinstance(node, ast.ClassDef):
continue
func_names = []
for child in ast.iter_child_nodes(node):
if isinstance(child, ast.FunctionDef):
func_names.append(child.name)
seen_func_names = set()
duplicate_func_names = []
for name in func_names:
if name in seen_func_names:
duplicate_func_names.append(name)
else:
seen_func_names.add(name)
if len(duplicate_func_names) != 0:
print(f'Multiple func names found:\n\t{duplicate_func_names}\n\tclass {node.name}\n\tfile: {filename}')
```
This patch fixes these cases.
This commit is contained in:
1 parent
6cb45aea92
commit
a4c18137d8
10 files changed
+8
-53
No files matched your search
@@ -17,7 +17,7 @@ class PluginPythonOSPlugin(TestBase):
|
||||
self.build()
|
||||
self.run_python_os_funcionality()
|
||||
|
||||
def run_python_os_step(self):
|
||||
def test_run_python_os_step(self):
|
||||
"""Test that the Python operating system plugin works correctly when single stepping a virtual thread"""
|
||||
self.build()
|
||||
self.run_python_os_step()
|
||||
|
||||
Reference in new issue
Block a user