Enable the shared terminal on WiFi-only Companions
This commit is contained in:
1 parent
c946adadfe
commit
373c2daebe
7 files changed
+65
-29
No files matched your search
@@ -73,6 +73,9 @@ class FirmwareRamTest(unittest.TestCase):
|
||||
psram = ram.requirements("ESP32_PLATFORM", {**defines, "BOARD_HAS_PSRAM": 1}, "v4_companion")
|
||||
self.assertEqual(plain["required_heap_bytes"] - base["required_heap_bytes"], 6144)
|
||||
self.assertEqual(psram["required_heap_bytes"] - base["required_heap_bytes"], 2048)
|
||||
wifi_only = dict(defines)
|
||||
del wifi_only["ENABLE_USB_INTERFACE"]
|
||||
self.assertEqual(ram.requirements("ESP32_PLATFORM", wifi_only, "v4_companion"), plain)
|
||||
repeater = ram.requirements("ESP32_PLATFORM", defines, "v4_repeater")
|
||||
self.assertNotIn("browser_terminal_session", repeater["components"])
|
||||
|
||||
@@ -237,7 +240,7 @@ int main() {
|
||||
base = ram.requirements("ESP32_PLATFORM", {}, "companion")["required_heap_bytes"]
|
||||
flags = {"BLE_PIN_CODE": 1, "WIFI_SSID": "test", "WITH_MQTT_BRIDGE": 1}
|
||||
both = ram.requirements("ESP32_PLATFORM", flags, "companion")["required_heap_bytes"]
|
||||
self.assertEqual(both - base, 32768 + 49152 + 24576)
|
||||
self.assertEqual(both - base, 32768 + 49152 + 24576 + 6144)
|
||||
flags["COMPANION_EXCLUSIVE_WIFI_BLE"] = 1
|
||||
self.assertEqual(ram.requirements("ESP32_PLATFORM", flags, "companion")["required_heap_bytes"], both - 32768)
|
||||
self.assertGreater(ram.requirements("NRF52_PLATFORM", {"DISPLAY_CLASS": "ST7735Display"}, "companion")["required_heap_bytes"],
|
||||
|
||||
@@ -9,6 +9,22 @@ ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
|
||||
class WebTerminalStreamTest(unittest.TestCase):
|
||||
def test_terminal_feature_compiles_with_wifi_without_usb(self):
|
||||
for defines, enabled in [
|
||||
(["ESP32_PLATFORM", 'WIFI_SSID="ssid"'], True),
|
||||
(["ESP32_PLATFORM", 'WIFI_SSID="ssid"', "WEBCONFIG_DISABLED"], False),
|
||||
(["NRF52_PLATFORM", "ENABLE_USB_INTERFACE"], True),
|
||||
(["ESP32_PLATFORM"], False),
|
||||
]:
|
||||
with self.subTest(defines=defines):
|
||||
result = subprocess.run([
|
||||
"c++", "-E", "-dM", "-x", "c++", "-", "-I" + str(ROOT / "src"),
|
||||
"-include", str(ROOT / "examples/companion_radio/CompanionFeatures.h"),
|
||||
*["-D" + value for value in defines],
|
||||
], input="", text=True, capture_output=True, check=True)
|
||||
self.assertIn("#define COMPANION_FEATURE_TEXT_TERMINAL " + str(int(enabled)),
|
||||
result.stdout)
|
||||
|
||||
def test_growth_drain_failure_and_release(self):
|
||||
headers = {
|
||||
"Arduino.h": """#pragma once
|
||||
|
||||
Reference in new issue
Block a user