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

Function save_cache

tests/test_metadata_cache.py:116–133  ·  view source on GitHub ↗

Save test metadata to cache file. Args: build_dir: Meson build directory tests_hash: Hash of test file metadata metadata: Test metadata output from organize_tests.py

(build_dir: Path, tests_hash: str, metadata: str)

Source from the content-addressed store, hash-verified

114
115
116def save_cache(build_dir: Path, tests_hash: str, metadata: str) -> None:
117 """
118 Save test metadata to cache file.
119
120 Args:
121 build_dir: Meson build directory
122 tests_hash: Hash of test file metadata
123 metadata: Test metadata output from organize_tests.py
124 """
125 import time
126
127 cache_file = build_dir / CACHE_FILENAME
128 build_dir.mkdir(parents=True, exist_ok=True)
129
130 cache = {"hash": tests_hash, "timestamp": time.time(), "metadata": metadata}
131
132 with open(cache_file, "w", encoding="utf-8") as f:
133 json.dump(cache, f, indent=2)
134
135
136def parse_metadata(metadata: str) -> set[str]:

Callers 1

mainFunction · 0.70

Calls 2

timeMethod · 0.80
dumpMethod · 0.45

Tested by

no test coverage detected