diff options
| author | Michael Buch <michaelbuch12@gmail.com> | 2024-06-28 20:08:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-28 20:08:53 +0100 |
| commit | a4c18137d84bc48df49ee0101bef465a955e62ac (patch) | |
| tree | 0fdab8e2ed56f00a6dfbb544d31dda940d842d6a /lldb/test/API/functionalities/plugins/python_os_plugin | |
| parent | 6cb45aea92dc87974a0064c182600228c6e94329 (diff) | |
[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.
Diffstat (limited to 'lldb/test/API/functionalities/plugins/python_os_plugin')
| -rw-r--r-- | lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py b/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py index 859e87cf75a5..e03e8e0df778 100644 --- a/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py +++ b/lldb/test/API/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py @@ -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() |
