Repair shared radio and build-profile test fixtures

This commit is contained in:
mikecarper committed 2026-10-22 17:49:04 -07:00
1 parent af106a0ee9
commit 4288402739
4 files changed
+9 -4

No files matched your search

+1 -1
View File
@@ -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
+1 -1
View File
@@ -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 <RadioProfiles.h>\n#include <helpers/MorseTx.h>\n#include <helpers/MorseRx.h>\n#include <helpers/RegulatorMode.h>\nnamespace mesh {\n"
return ("#pragma once\n#include <RadioProfiles.h>\n#include <helpers/MorseTx.h>\n#include <helpers/MorseRx.h>\n#include <helpers/RegulatorMode.h>\n#include <helpers/TelemetryHistoryConfig.h>\nnamespace mesh {\n"
+ method(dispatcher, "enum class RadioParamApplyResult") + ";\n"
+ method(dispatcher, "class Radio {") + ";\n}\n")
+3
View File
@@ -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)
+4 -2
View File
@@ -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'),