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

Function measure_one

tests/measure_esp32s3_opt_ins.py:347–372  ·  view source on GitHub ↗

Build + bloat one config; return total_flash or None on failure.

(cfg: OptInConfig, example: str)

Source from the content-addressed store, hash-verified

345
346
347def measure_one(cfg: OptInConfig, example: str) -> int | None:
348 """Build + bloat one config; return total_flash or None on failure."""
349 print(f"\n=== measure-opt-ins: config {cfg.name} ({cfg.label}) ===", flush=True)
350 restore_platformio_ini(keep_backup=True)
351 patch_platformio_ini(cfg)
352 _force_relink()
353 if not run_compile(example, cfg.name):
354 print(f"measure-opt-ins: compile failed for {cfg.name}", file=sys.stderr)
355 return None
356 if not run_bloat(cfg.name):
357 print(f"measure-opt-ins: bloat run failed for {cfg.name}", file=sys.stderr)
358 return None
359 total = read_total_flash()
360 if total is None:
361 print(
362 f"measure-opt-ins: report.json missing after {cfg.name} bloat run",
363 file=sys.stderr,
364 )
365 return None
366 archived = archive_report(cfg)
367 print(
368 f"measure-opt-ins: {cfg.name} total_flash = {total:,} B "
369 f"(report archived: {archived.relative_to(PROJECT_ROOT).as_posix()})",
370 flush=True,
371 )
372 return total
373
374
375def format_table(results: dict[str, int]) -> str:

Callers 1

mainFunction · 0.85

Calls 8

restore_platformio_iniFunction · 0.85
patch_platformio_iniFunction · 0.85
_force_relinkFunction · 0.85
read_total_flashFunction · 0.85
archive_reportFunction · 0.85
run_compileFunction · 0.70
run_bloatFunction · 0.70
printFunction · 0.50

Tested by

no test coverage detected