Fix bridge runtime harness extraction around packet logging guards

This commit is contained in:
mikecarper committed 2026-10-17 20:23:30 -07:00
1 parent 3db4582bbb
commit 4bc6535f4d
3 files changed
+9 -4

No files matched your search

+2 -1
View File
@@ -35,7 +35,8 @@ class ESPNowRuntimeTests(unittest.TestCase):
for name in ("logRx", "logTx"):
start = implementation.index("void MyMesh::" + name + "(")
start = implementation.index("#ifdef WITH_MQTT_BRIDGE\n", start)
end = implementation.index(" if (_logging)", start)
# Keep the complete bridge guards, stopping before file logging's guard.
end = implementation.index("#if MESH_ENABLE_PACKET_FILE_LOGGING\n", start)
routing[name] = implementation[start:end]
service_start = implementation.index("#if defined(WITH_ESPNOW_BRIDGE)",
implementation.index("MyMesh::servicePostMeshLoop()"))
+5 -2
View File
@@ -55,7 +55,8 @@ class RS232MQTTRuntimeTests(unittest.TestCase):
for name in ("logRx", "logTx"):
start = implementation.index("void MyMesh::" + name + "(")
start = implementation.index("#ifdef WITH_MQTT_BRIDGE\n", start)
end = implementation.index(" if (_logging)", start)
# Keep the complete bridge guards, stopping before file logging's guard.
end = implementation.index("#if MESH_ENABLE_PACKET_FILE_LOGGING\n", start)
routing[name] = implementation[start:end]
service_start = implementation.index("#if defined(WITH_MQTT_BRIDGE)\n // MQTT owns TLS",
implementation.index("MyMesh::servicePostMeshLoop()"))
@@ -163,7 +164,9 @@ class RS232MQTTRuntimeTests(unittest.TestCase):
route = {}
for name in ("logRx", "logTx"):
start = implementation.index("#ifdef WITH_MQTT_BRIDGE\n", implementation.index("void MyMesh::" + name + "("))
route[name] = implementation[start:implementation.index(" if (_logging)", start)]
# Keep the complete bridge guards, stopping before file logging's guard.
end = implementation.index("#if MESH_ENABLE_PACKET_FILE_LOGGING\n", start)
route[name] = implementation[start:end]
ota_start = cli.index(' } else if (memcmp(command, "start ota", 9)')
defaults_start = implementation.index("// bridge defaults")
substitutions = {
+2 -1
View File
@@ -222,7 +222,8 @@ class RS232RuntimeTests(unittest.TestCase):
for name in ("logRx", "logTx"):
start = implementation.index("void MyMesh::" + name + "(")
start = implementation.index("#ifdef WITH_MQTT_BRIDGE\n", start)
end = implementation.index(" if (_logging)", start)
# Keep the complete bridge guards, stopping before file logging's guard.
end = implementation.index("#if MESH_ENABLE_PACKET_FILE_LOGGING\n", start)
routing[name] = implementation[start:end]
loop_start = implementation.index("#if defined(WITH_ESPNOW_BRIDGE)",
implementation.index("MyMesh::servicePostMeshLoop()"))