[benchmark] Fix plaintext frame benchmark build: enable api codegen

This commit is contained in:
J. Nick Koston
2026-03-20 16:02:44 -10:00
parent 9bd5d91e61
commit 328ef819e6
2 changed files with 13 additions and 0 deletions
@@ -0,0 +1,8 @@
from tests.testing_helpers import ComponentManifestOverride
def override_manifest(manifest: ComponentManifestOverride) -> None:
# api must run its to_code during benchmark builds because it
# defines USE_API, USE_API_PLAINTEXT, and USE_API_NOISE which
# are needed by the frame helper headers.
manifest.enable_codegen()
@@ -1,3 +1,6 @@
#include "esphome/core/defines.h"
#ifdef USE_API_PLAINTEXT
#include <benchmark/benchmark.h>
#include <fcntl.h>
#include <sys/socket.h>
@@ -122,3 +125,5 @@ static void PlaintextFrame_WriteBatch5(benchmark::State &state) {
BENCHMARK(PlaintextFrame_WriteBatch5);
} // namespace esphome::api::benchmarks
#endif // USE_API_PLAINTEXT