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

Function load_test_names

ci/early_exit_cache.py:121–145  ·  view source on GitHub ↗

Load cached test names from disk (stdlib only, no ci.* imports). Mirrors ci/meson/test_discovery._load_introspect_tests_cache() without importing that module (which pulls hashlib, subprocess, global_interrupt_handler). Args: build_dir: Meson build directory (e.g., .build/meson-

(build_dir: Path)

Source from the content-addressed store, hash-verified

119
120
121def load_test_names(build_dir: Path) -> list:
122 """Load cached test names from disk (stdlib only, no ci.* imports).
123
124 Mirrors ci/meson/test_discovery._load_introspect_tests_cache() without
125 importing that module (which pulls hashlib, subprocess, global_interrupt_handler).
126
127 Args:
128 build_dir: Meson build directory (e.g., .build/meson-quick/).
129
130 Returns:
131 List of cached test names, or empty list if cache is invalid.
132 """
133 cache_path = build_dir / ".meson_introspect_tests_cache.json"
134 build_ninja = build_dir / "build.ninja"
135 if not cache_path.exists() or not build_ninja.exists():
136 return []
137 try:
138 if cache_path.stat().st_mtime < build_ninja.stat().st_mtime:
139 return []
140 data = json.loads(cache_path.read_text(encoding="utf-8"))
141 if isinstance(data, list) and (not data or isinstance(data[0], str)):
142 return data
143 return []
144 except (OSError, json.JSONDecodeError):
145 return []
146
147
148def ninja_skip(

Callers 1

check_single_test_cachedFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected