Find all examples in the examples directory. Args: project_dir: Project root directory Returns: List of TestMatch objects for examples
(project_dir: Path)
| 296 | |
| 297 | |
| 298 | def _find_examples(project_dir: Path) -> list[TestMatch]: |
| 299 | """Find all examples in the examples directory. |
| 300 | |
| 301 | Args: |
| 302 | project_dir: Project root directory |
| 303 | |
| 304 | Returns: |
| 305 | List of TestMatch objects for examples |
| 306 | """ |
| 307 | examples_dir = project_dir / "examples" |
| 308 | if not examples_dir.exists(): |
| 309 | return [] |
| 310 | |
| 311 | matches: list[TestMatch] = [] |
| 312 | |
| 313 | # Find all .ino files in examples directory |
| 314 | for ino_file in examples_dir.rglob("*.ino"): |
| 315 | # Example name is the directory name |
| 316 | example_name = ino_file.parent.name |
| 317 | |
| 318 | # Get relative path to example directory |
| 319 | rel_path = ino_file.parent.relative_to(project_dir) |
| 320 | |
| 321 | matches.append( |
| 322 | TestMatch( |
| 323 | name=example_name, |
| 324 | path=str(rel_path).replace("\\", "/"), |
| 325 | type="example", |
| 326 | score=0.0, # Will be calculated during matching |
| 327 | ) |
| 328 | ) |
| 329 | |
| 330 | return matches |
| 331 | |
| 332 | |
| 333 | def _find_aggregator_matches( |
no test coverage detected