mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-01 22:19:49 +08:00
6d316f2bc7
date: 2024-06-11T01:36:39 master commit: f8cb04e4a8b032b72a909f68b808a50936184bee
26 lines
697 B
Python
26 lines
697 B
Python
#!/usr/bin/env python3
|
|
import os
|
|
import tempfile
|
|
from typing import Dict
|
|
import unittest
|
|
from parameterized import parameterized
|
|
|
|
import cereal.services as services
|
|
from cereal.services import SERVICE_LIST
|
|
|
|
|
|
class TestServices(unittest.TestCase):
|
|
|
|
@parameterized.expand(SERVICE_LIST.keys())
|
|
def test_services(self, s):
|
|
service = SERVICE_LIST[s]
|
|
self.assertTrue(service.frequency <= 104)
|
|
|
|
def test_generated_header(self):
|
|
with tempfile.NamedTemporaryFile(suffix=".h") as f:
|
|
ret = os.system(f"python3 {services.__file__} > {f.name} && clang++ {f.name}")
|
|
self.assertEqual(ret, 0, "generated services header is not valid C")
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|