mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-10-28 00:53:45 +08:00
Build Auto Learn recording and replay
This commit is contained in:
Binary file not shown.
Binary file not shown.
+1
-1
@@ -1 +1 @@
|
||||
{"protected_inventory_sha256": "25f884a9a6495f49cc4c52130811797f029a4f4ff31dd43626d0dc0c7fdae940", "schema_version": 1}
|
||||
{"protected_inventory_sha256": "bd3e07f30455b24cea8521ad2fc9ed98041abdabc8b3a82e01d471d9e56e80a9", "schema_version": 1}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Catch device binaries linked to build-environment Cap'n Proto/KJ libraries."""
|
||||
|
||||
from pathlib import Path
|
||||
import ast
|
||||
import subprocess
|
||||
import sys
|
||||
import unittest
|
||||
@@ -22,3 +23,26 @@ class DeviceRuntimeDependenciesTest(unittest.TestCase):
|
||||
dynamic = subprocess.check_output(['readelf', '--dynamic', '--wide', str(ROOT / binary)], text=True)
|
||||
self.assertNotRegex(dynamic, r'\(NEEDED\).*\[.*lib(?:capnp|kj)',
|
||||
f"{binary}: link Cap'n Proto/KJ statically for AGNOS")
|
||||
|
||||
|
||||
class LiveSteeringServiceInventoryTest(unittest.TestCase):
|
||||
def test_live_steering_tracking_is_registered_in_shipped_native_consumers(self):
|
||||
service = 'starpilotSteeringTracking'
|
||||
tree = ast.parse((ROOT / 'openpilot/cereal/services.py').read_text())
|
||||
declarations = [node.value for node in tree.body if isinstance(node, ast.AnnAssign)
|
||||
and isinstance(node.target, ast.Name) and node.target.id == '_services']
|
||||
self.assertEqual(len(declarations), 1)
|
||||
table = declarations[0]
|
||||
if not isinstance(table, ast.Dict):
|
||||
self.fail('Service registry must be a dictionary')
|
||||
declared = [value for key, value in zip(table.keys, table.values, strict=True)
|
||||
if isinstance(key, ast.Constant) and key.value == service]
|
||||
self.assertEqual(len(declared), 1)
|
||||
definition = declared[0]
|
||||
if not isinstance(definition, ast.Tuple):
|
||||
self.fail('Service declaration must be a tuple')
|
||||
self.assertIs(ast.literal_eval(definition.elts[0]), True)
|
||||
for binary in ('openpilot/system/loggerd/loggerd', 'openpilot/tools/replay/replay'):
|
||||
with self.subTest(binary=binary):
|
||||
self.assertIn(service.encode(), (ROOT / binary).read_bytes(),
|
||||
f'{binary}: rebuild after changing the native service registry')
|
||||
|
||||
Reference in New Issue
Block a user