mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-24 03:22:23 +00:00
Keep extracted command fixtures independent of regulator storage
This commit is contained in:
1 parent
a886f618f1
commit
3f062740eb
3 files changed
+17
-2
No files matched your search
+1
@@ -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
|
||||
|
||||
Vendored
+10
@@ -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; }
|
||||
}}
|
||||
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user