Files
mi8-platina-linux/tests/test_cellular_bam_format.py
2026-11-18 01:39:26 +09:00

20 lines
779 B
Python

"""Compile the actual command encoder and check its wire bytes and bounds."""
from pathlib import Path
import shutil
import subprocess
import tempfile
import unittest
class BamCommandFormatTest(unittest.TestCase):
def test_command_encoding(self):
compiler = shutil.which("cc")
if not compiler:
self.skipTest("native C compiler not available")
source = Path(__file__).with_name("ipa_v2_cmd_format.c")
with tempfile.TemporaryDirectory() as directory:
executable = Path(directory) / "ipa-v2-format-test"
subprocess.run([compiler, "-std=c11", "-Wall", "-Wextra", "-Werror",
str(source), "-o", str(executable)], check=True)
subprocess.run([str(executable)], check=True)