Resolve Mini build helpers from the PlatformIO project directory
This commit is contained in:
1 parent
4261889095
commit
b7c048f3f7
2 files changed
+12
-1
No files matched your search
@@ -12,7 +12,7 @@ if env["PIOENV"] == "wio-e5-mini_repeater":
|
||||
# Reuse the qualified RAK CLI's equivalent libc reply copies. Restrict
|
||||
# this flag to CommonCLI.cpp; radio, framework and other objects retain
|
||||
# the existing optimizer recipe.
|
||||
source = Path(__file__).resolve().with_name("nrf52_flash_trim.py")
|
||||
source = Path(env.subst("$PROJECT_DIR/scripts/nrf52_flash_trim.py")).resolve()
|
||||
spec = importlib.util.spec_from_file_location("mesh_mini_cli_replies", source)
|
||||
replies = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(replies)
|
||||
|
||||
@@ -159,6 +159,17 @@ class MiniRepeaterProfileTest(unittest.TestCase):
|
||||
other = Node(ROOT / path)
|
||||
self.assertIs(callback(environment, other), other)
|
||||
|
||||
def test_scons_script_context_without_file_still_installs_exact_cli_policy(self):
|
||||
script = ROOT / "scripts/stm32_mini_size.py"
|
||||
environment = FakeEnvironment(PIOENV=TARGET)
|
||||
namespace = {"env": environment,
|
||||
"Import": lambda name: self.assertEqual(name, "env")}
|
||||
exec(compile(script.read_text(), str(script), "exec"), namespace)
|
||||
self.assertNotIn("__file__", namespace)
|
||||
self.assertEqual(environment["LINKFLAGS"], list(LINK_SIZE_FLAGS))
|
||||
self.assertEqual(len(environment.middleware), 1)
|
||||
self.assertEqual(environment.middleware[0][1], "*CommonCLI.cpp")
|
||||
|
||||
def test_capability_contract_declares_only_exact_mini_repeater_omissions(self):
|
||||
command = r'''
|
||||
set -euo pipefail
|
||||
|
||||
Reference in new issue
Block a user