Files
bproto/test/compiler/backend/test_comiler_c.py
2025-04-14 14:43:03 +02:00

27 lines
696 B
Python

import sys
from compiler import BprotoCompiler
sys.path.append('src/')
from errors import BprotoCompilerError
from backend.rendering.cBackend import CBackendRenderer
from backend.fsOutput import BackendFileSystemOutput
def test_compiler_c_smoke_test():
# Load Refernces
with open("test/test_protocol.bproto") as f:
source_text = f.read()
# Comile Stuff
compiler = BprotoCompiler([
CBackendRenderer(".")
], "template")
try:
output: BackendFileSystemOutput = compiler.compile(source_text, ".")
except BprotoCompilerError:
assert False, "This should run througth"
output.saveToDisk("test/backend_output/c")
output.toString()