Keep extracted command fixtures independent of regulator storage

This commit is contained in:
mikecarper committed 2026-10-18 22:01:46 -07:00
1 parent a886f618f1
commit 3f062740eb
3 files changed
+17 -2

No files matched your search

+1
View File
@@ -6,6 +6,7 @@
#include <cassert>
#include <cstddef>
#include <cstdint>
#include "regulator_cli_stub.h"
// These narrower dispatch fixtures retain the complete production fleet branch
// but have no channel peripheral. The separate companion fleet suite compiles
+10
View File
@@ -0,0 +1,10 @@
#pragma once
#include <cstddef>
// These dispatch fixtures isolate another command family from the regulator
// subsystem. Its real settings, reset and persistence paths have dedicated
// executable tests in test_regulator_settings.py; an unrelated command falls
// through without changing the reply or requiring a board/filesystem adapter.
namespace mesh { namespace power {
inline bool handleRegulatorCommand(const char*, char*, size_t) { return false; }
}}
+6 -2
View File
@@ -27,6 +27,7 @@ HARNESS = r'''
#include <string>
#include <vector>
#include <helpers/FleetCommand.h>
#include "regulator_cli_stub.h"
#include <helpers/CompanionFrameLimits.h>
#include <openssl/evp.h>
@@ -1286,7 +1287,7 @@ class CompanionFleetControlTests(unittest.TestCase):
compiler, "-std=c++17", "-Wall", "-Wextra", "-Werror",
"-Wno-unused-parameter", "-O2", *sanitizer_flags,
"-fstack-usage", "-isystem", str(ROOT / "test/mocks"),
"-I", str(ROOT / "src"), str(fixture),
"-I", str(ROOT / "src"), "-I", str(ROOT / "test/fixtures"), str(fixture),
str(ROOT / "src/helpers/FleetCommand.cpp"), "-lcrypto", "-o", str(cls.binary),
], capture_output=True, text=True, timeout=60)
if result.returncode:
@@ -1353,6 +1354,7 @@ class CompanionFleetControlTests(unittest.TestCase):
self.compiler, "-std=c++17", "-Wall", "-Wextra", "-Werror",
"-Wno-unused-parameter", "-DSTM32_PLATFORM=1", "-O2", *self.sanitizer_flags,
"-isystem", str(ROOT / "test/mocks"), "-I", str(ROOT / "src"),
"-I", str(ROOT / "test/fixtures"),
str(self.fixture), str(ROOT / "src/helpers/FleetCommand.cpp"),
"-lcrypto", "-o", str(binary),
], capture_output=True, text=True, timeout=60)
@@ -1449,6 +1451,7 @@ class CompanionFleetControlTests(unittest.TestCase):
#include <cstdio>
#include <cstring>
#include <helpers/FleetCommand.h>
#include "regulator_cli_stub.h"
static_assert(MESH_ENABLE_FLEET_CONTROL == 0, "compact profile must disable fleet");
// No channels, clock, signing identity, codec definitions or sendGroupData.
class MyMesh {
@@ -1474,7 +1477,8 @@ int main() {
built = subprocess.run([
self.compiler, "-std=c++17", "-Wall", "-Wextra", "-Werror",
"-Wno-unused-parameter", "-isystem", str(ROOT / "test/mocks"),
"-I", str(ROOT / "src"), *flags, str(source), "-o", str(executable),
"-I", str(ROOT / "src"), "-I", str(ROOT / "test/fixtures"),
*flags, str(source), "-o", str(executable),
], capture_output=True, text=True, timeout=60)
self.assertEqual(built.returncode, 0, built.stdout + built.stderr)
result = subprocess.run([str(executable)], capture_output=True,