From 4288402739fdf80f871233432bcf62ee7548617f Mon Sep 17 00:00:00 2001 From: mikecarper Date: Thu, 22 Oct 2026 17:49:04 -0700 Subject: [PATCH] Repair shared radio and build-profile test fixtures --- test/test_build_profiles.sh | 2 +- test/test_morse_tx.py | 2 +- test/test_remote_cli_command_identity.py | 3 +++ test/test_repeater_trace_forwarding.py | 6 ++++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/test/test_build_profiles.sh b/test/test_build_profiles.sh index a7061eed7..15c2468ce 100644 --- a/test/test_build_profiles.sh +++ b/test/test_build_profiles.sh @@ -1449,7 +1449,7 @@ done ) for primary_flag in MESH_PRIMARY_ESPNOW MESH_ESPNOW_RADIO; do ( - pio_env_option_contains() { [ "$3" = "$primary_flag" ]; } + pio_env_has_effective_define() { [ "$2" = "$primary_flag" ]; } PLATFORMIO_BUILD_FLAGS="" PLATFORMIO_BUILD_SRC_FILTER="" if supports_esp32_full_shared_espnow heltec_v4_tft_repeater; then diff --git a/test/test_morse_tx.py b/test/test_morse_tx.py index a3a91ae23..31cca9862 100644 --- a/test/test_morse_tx.py +++ b/test/test_morse_tx.py @@ -15,7 +15,7 @@ SANITIZERS = ["-fsanitize=address,undefined", "-fno-sanitize-recover=all", "-fno def portable_radio_header(): """Use the exact Radio interface without unrelated packet/crypto mocks.""" dispatcher = (ROOT / "src/Dispatcher.h").read_text(encoding="utf-8") - return ("#pragma once\n#include \n#include \n#include \n#include \nnamespace mesh {\n" + return ("#pragma once\n#include \n#include \n#include \n#include \n#include \nnamespace mesh {\n" + method(dispatcher, "enum class RadioParamApplyResult") + ";\n" + method(dispatcher, "class Radio {") + ";\n}\n") diff --git a/test/test_remote_cli_command_identity.py b/test/test_remote_cli_command_identity.py index cd36dfa5e..c373b2edb 100644 --- a/test/test_remote_cli_command_identity.py +++ b/test/test_remote_cli_command_identity.py @@ -26,6 +26,9 @@ class RemoteCliCommandIdentityTest(unittest.TestCase): normalize_end = source.index(" mesh::cli::normalizeCommandVerb(command);", normalize_start) normalize_end += len(" mesh::cli::normalizeCommandVerb(command);") mutation = source[trim_start:trim_end] + "\n" + source[normalize_start:normalize_end] + # The full handler consumes this flag in its later telemetry reply + # branch, outside this normalization-only boundary. + mutation += "\n#if MESH_ENABLE_TELEMETRY_HISTORY\n(void)prefixed_reply;\n#endif\n" # setperm splits the argument in the same buffer; retain its real # delimiter mutation without pulling ACL/filesystem hardware into this test. setperm = source.index('char* hex = &command[8];', normalize_end) diff --git a/test/test_repeater_trace_forwarding.py b/test/test_repeater_trace_forwarding.py index b26b30403..8d51e0e01 100644 --- a/test/test_repeater_trace_forwarding.py +++ b/test/test_repeater_trace_forwarding.py @@ -1,5 +1,6 @@ """Execute actual repeater trace gates with the production Packet definition.""" from pathlib import Path +from itertools import product import os import shutil import subprocess @@ -247,13 +248,14 @@ class RepeaterTraceForwardingTest(unittest.TestCase): cpp = work / 'test.cpp' cpp.write_text(code, encoding='utf-8') (work / 'Dispatcher.h').write_text(portable_radio_header(), encoding='utf-8') - for portable, morse_rx in ((False, 1), (True, 1), (False, 0), (True, 0)): - with self.subTest(portable=portable, morse_rx=morse_rx): + for portable, morse_rx, history in product((False, True), (0, 1), (0, 1)): + with self.subTest(portable=portable, morse_rx=morse_rx, history=history): binary = work / 'test' built = subprocess.run([ compiler, '-std=c++17', '-Wall', '-Wextra', '-Werror', '-Wno-unused-parameter', f'-DMESH_ENABLE_MORSE_RX={morse_rx}', + f'-DMESH_ENABLE_TELEMETRY_HISTORY={history}', '-DMESH_ENABLE_FLOOD_GROUP_MODERATION=1', '-DMESH_ENABLE_CLOCK_SYNC=1', *(['-DPORTABLE_MQTT_OBSERVER=1'] if portable else []), *flags, '-I' + str(work), '-I' + str(ROOT / 'test/mocks'),