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

Function _get_aggregated_test_dirs

ci/lint_cpp/test_aggregation_checker.py:38–65  ·  view source on GitHub ↗

Get excluded test dirs that follow the aggregation pattern. Only returns dirs under tests/fl/ — these are the ones that must have a parent .cpp aggregator. Infrastructure dirs (tests/shared, tests/data, etc.) are excluded from discovery for other reasons.

()

Source from the content-addressed store, hash-verified

36
37
38def _get_aggregated_test_dirs() -> set[Path]:
39 """Get excluded test dirs that follow the aggregation pattern.
40
41 Only returns dirs under tests/fl/ — these are the ones that must have
42 a parent .cpp aggregator. Infrastructure dirs (tests/shared, tests/data,
43 etc.) are excluded from discovery for other reasons.
44 """
45 global _AGGREGATED_TEST_DIRS
46 if _AGGREGATED_TEST_DIRS is not None:
47 return _AGGREGATED_TEST_DIRS
48 import importlib.util
49
50 config_path = TESTS_DIR / "test_config.py"
51 try:
52 spec = importlib.util.spec_from_file_location("test_config", config_path)
53 if spec is None or spec.loader is None:
54 raise ImportError(f"Cannot load {config_path}")
55 mod = importlib.util.module_from_spec(spec)
56 spec.loader.exec_module(mod)
57 all_excluded: set[Path] = mod.EXCLUDED_TEST_DIRS # type: ignore[attr-defined]
58 except (ImportError, AttributeError, FileNotFoundError):
59 _AGGREGATED_TEST_DIRS = set()
60 return _AGGREGATED_TEST_DIRS
61
62 # Filter to only dirs under tests/fl/ (the aggregation pattern dirs)
63 fl_tests = TESTS_DIR / "fl"
64 _AGGREGATED_TEST_DIRS = {d for d in all_excluded if d.is_relative_to(fl_tests)}
65 return _AGGREGATED_TEST_DIRS
66
67
68# Pattern matching #include "subdir/file.ext"

Callers 2

checkFunction · 0.85
check_single_fileFunction · 0.85

Calls 1

setClass · 0.50

Tested by

no test coverage detected