MCPcopy Create free account
hub / github.com/FastLED/FastLED / _find_unit_tests

Function _find_unit_tests

ci/util/smart_selector.py:263–295  ·  view source on GitHub ↗

Find all unit test files in the tests directory. Args: project_dir: Project root directory Returns: List of TestMatch objects for unit tests

(project_dir: Path)

Source from the content-addressed store, hash-verified

261
262
263def _find_unit_tests(project_dir: Path) -> list[TestMatch]:
264 """Find all unit test files in the tests directory.
265
266 Args:
267 project_dir: Project root directory
268
269 Returns:
270 List of TestMatch objects for unit tests
271 """
272 tests_dir = project_dir / "tests"
273 if not tests_dir.exists():
274 return []
275
276 matches: list[TestMatch] = []
277
278 # Find all .cpp files in tests directory
279 for cpp_file in tests_dir.rglob("*.cpp"):
280 # Get test name (filename without extension)
281 test_name = cpp_file.stem
282
283 # Get relative path from project root
284 rel_path = cpp_file.relative_to(project_dir)
285
286 matches.append(
287 TestMatch(
288 name=test_name,
289 path=str(rel_path).replace("\\", "/"),
290 type="unit_test",
291 score=0.0, # Will be calculated during matching
292 )
293 )
294
295 return matches
296
297
298def _find_examples(project_dir: Path) -> list[TestMatch]:

Callers 2

smart_selectFunction · 0.85
discover_all_testsFunction · 0.85

Calls 2

TestMatchClass · 0.85
appendMethod · 0.45

Tested by

no test coverage detected