Files
sunnypilot/cereal/messaging/tests/test_services.py
DevTekVE 8f7bbe4ee3 macos: use /tmp instead of /dev/shm (#34097)
* No /dev/shm on MacOS so we go to tmp instead given that the /dev/shm makes tests not really work fine on mac

* Cleanups

Fix cereal messaging tests

* keep msgq stock

More shm updates for macos

* typo

* fix return

* Semicolon...
2024-12-04 10:51:09 -08:00

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"