mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-03 06:33:50 +08:00
eefc084302
version: sunnypilot v2025.003.000 (dev) date: 2025-12-18T05:48:43 master commit: 16c052af0835f049a67b80251d8cc1114fc08bb4
22 lines
620 B
Python
22 lines
620 B
Python
import os
|
|
import tempfile
|
|
from typing import Dict
|
|
from parameterized import parameterized
|
|
|
|
import cereal.services as services
|
|
from cereal.services import SERVICE_LIST
|
|
|
|
|
|
class TestServices:
|
|
|
|
@parameterized.expand(SERVICE_LIST.keys())
|
|
def test_services(self, s):
|
|
service = SERVICE_LIST[s]
|
|
assert service.frequency <= 104
|
|
assert service.decimation != 0
|
|
|
|
def test_generated_header(self):
|
|
with tempfile.NamedTemporaryFile(suffix=".h") as f:
|
|
ret = os.system(f"python3 {services.__file__} > {f.name} && clang++ {f.name} -std=c++11")
|
|
assert ret == 0, "generated services header is not valid C"
|