#!/usr/bin/env python3 """Сборка и проверка независимого ядра без Qt и CMake.""" import os,subprocess,tempfile from pathlib import Path root=Path(__file__).resolve().parents[1] with tempfile.TemporaryDirectory(prefix='ald-rules-') as temporary: binary=str(Path(temporary)/'test_rules') command=['g++','-std=c++17','-Wall','-Wextra','-Wpedantic','-Werror','-fsanitize=address,undefined','-fno-omit-frame-pointer','-g','-I'+str(root/'src'),str(root/'src/core/Rules.cpp'),str(root/'tests/unit/test_rules.cpp'),'-o',binary] subprocess.run(command,check=True) environment=os.environ.copy() # LeakSanitizer cannot inspect processes in the managed sandbox/ptrace context. # ASan bounds checking and UBSan remain enabled. This does not claim leak coverage. environment['ASAN_OPTIONS']='detect_leaks=0' subprocess.run([binary],check=True,env=environment)