5from __future__
import annotations
8from pathlib
import Path
15_logger = logging.getLogger(__name__)
18HW_DIR = ROOT_DIR /
"hw"
19SW_DIR = ROOT_DIR /
"sw"
24def require_tool(tool: str) ->
None:
25 if shutil.which(tool)
is None:
26 pytest.skip(f
"Required tool not found in PATH: {tool}")
30 value = os.environ.get(var_name)
32 pytest.skip(f
"Required environment variable not set: {var_name}")
36def run_cmd(cmd, **kwargs) -> str:
37 """Run a command, capture stdout, and return it. Raises on failure."""
38 _logger.info(
"run_cmd: %s", cmd)
39 result = subprocess.run(cmd,
44 _logger.debug(
"stdout: %s", result.stdout)
45 _logger.debug(
"stderr: %s", result.stderr)
49def check_lines(stdout: str, expected: list[str]) ->
None:
50 """Assert that every expected substring appears in stdout in order."""
53 idx = remaining.find(line)
55 f
"Expected output not found: {line!r}"
56 remaining = remaining[idx + len(line):]
static mlir::Operation * resolve(Context &context, mlir::SymbolRefAttr sym)
str require_env(str var_name)