itl_expr_cli 教程
本教程介绍如何用区间运行器运行 ITF1788 的 .itl 文件、选择运算,并解读其 JSON 报告。该运行器通过 floating-conformance --backend itl 调用;下文以 itl 简称这条命令。
快速入门
just conformance build interval
_build/conformance/itl/native/release/build/itl-conformance.exe --backend itl
不给路径时,运行器执行 testdata/interval/smoke.itl 并打印一个 JSON 对象,例如
{"schemaVersion":1,"runner":"itl-expression-interpreter","totalCases":…,"executableCases":…,"passedCases":…,"failedCases":0,…}
日常任务
运行文件
itl .tmp/interval/itf1788/libieeep1788_tests_set.itl
itl a.itl b.itl
路径必须是文件;按给定顺序读取。
选择运算
itl --operation add --operation sub libieeep1788_tests_elem.itl
只有运算名在所列名称之中的用例才会被执行和计数。
让不支持的运算导致失败
itl --strict-supported --operation sqrt libieeep1788_tests_elem.itl
不加该标志时,不支持的用例会在 unsupportedIds 中报告,但不影响退出状态;诊断用例则总会影响退出状态。
深入了解
just conformance run interval运行testdata/interval/interpreter_stages.json中列出的各阶段(每个阶段的文件与运算);加上--strict-supported可将严格模式传递给每个阶段。- itl_expr 教程 解释了用例和通过规则。
常见陷阱
- 没有
--json选项。 输出总是 JSON;传入--json会被视为未知选项(退出码2)。 - 不支持分片。 ITL 文件很小;工具链按阶段并行。
- 打印所有解析诊断,格式为
PATH: MESSAGE,并终止运行。