Add broker and web throughput diagnostics

This commit is contained in:
2026-09-08 22:40:58 +02:00
parent 36d41be422
commit 042499e4d6
20 changed files with 899 additions and 5 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/usr/bin/env python3
"""Compile unchanged production broker/console with isolated deterministic doubles.
No SDK, device, network, or persistent generated files required.
"""
from pathlib import Path
import shutil
import subprocess
import tempfile
HERE = Path(__file__).resolve().parent
ROOT = HERE.parent.parent
with tempfile.TemporaryDirectory(prefix="broker-diagnostics-") as directory:
build = Path(directory)
(build / "freertos").mkdir()
for name in ("session_broker.c", "session_broker.h", "session_console.c", "session_console.h"):
shutil.copyfile(ROOT / "src" / name, build / name)
shutil.copyfile(HERE / "fake.h", build / "fake.h")
shutil.copyfile(HERE / "test.c", build / "test.c")
for name in ("esp_err.h", "esp_heap_caps.h", "esp_console.h", "serial_service.h",
"freertos/FreeRTOS.h", "freertos/queue.h", "freertos/semphr.h",
"freertos/stream_buffer.h", "freertos/task.h"):
(build / name).write_text('#include "fake.h"\n')
subprocess.run(["cc", "-std=c11", "-D_POSIX_C_SOURCE=200809L", "-Wall", "-Wextra",
"-Werror", "-I", str(build), str(build / "test.c"),
"-o", str(build / "test")], check=True)
subprocess.run([str(build / "test")], check=True)