fix(test): use AArch64-specific YAML directory for capstone compat test
Robustone 是由华中科技大学开源原子俱乐部用 Rust 编写的实验性反汇编引擎。受 Capstone 项目启发,它探索如何利用 Rust 强大的安全保证来提供与 Capstone 兼容的体验,同时拥有更清洁的代码库和现代化的工具链。
Robustone 将与 Capstone 的兼容目标拆分为三层:
cstool
arch+mode
当前仓库状态:
riscv
riscv32
riscv64
docs/support-matrix.md
0.0.0
git
robustone/ # 顶层 crate(同时提供库和二进制入口) robustone-core/ # 架构相关的解码与格式化核心 robustone-cli/ # CLI 参数解析、输入校验与展示逻辑 docs/ # 支持矩阵和项目文档 tests/ # golden/property/differential 测试资源 fuzz/ # 解码器与 JSON 格式化的 fuzz 目标 Makefile # build/check/run/test 入口 test/ architectures/ # 各架构的一致性测试配置和测试集 run_tests.py # 一致性测试主入口 third_party/ capstone/ # 原始 Capstone 项目的可选检出(测试使用) Cargo.toml # Workspace 清单
克隆仓库(包括子模块,如果有的话)并安装上述工具链要求。捆绑的 Makefile 为常见工作流程提供了快捷方式:
Makefile
make build
make check
rustfmt
clippy
black
pylint
make format
make run
cargo run
make test
make test-quick
make help
test 目标在首次使用时会将 Capstone 下载到 third_party/capstone,通过 test/scripts/build_cstool.sh 构建比较工具,运行 python3 test/run_tests.py --all,最后执行 cargo test --workspace --all-features。
test
third_party/capstone
test/scripts/build_cstool.sh
python3 test/run_tests.py --all
cargo test --workspace --all-features
当前已实现的 RISC-V 后端尽量镜像经典 cstool 的使用方式。例如,要解码一条 RISC-V 指令并显示详细信息:
make run -- riscv32 93001000 -d
十六进制输入遵循 cstool 约定,按内存中的原始字节顺序解释。
或者,您可以使用 RUN_ARGS 变量。这样可以防止 make 错误解析 -d 等标志:
RUN_ARGS
make
-d
make run RUN_ARGS="riscv32 93001000 -d"
如果需要查看当前 CLI 暴露的完整参数面,请运行:
cargo run --manifest-path robustone/Cargo.toml -- --help
如果需要直接查看共享能力注册表导出的支持面,请运行:
cargo run --manifest-path robustone/Cargo.toml -- --capabilities cargo run --manifest-path robustone/Cargo.toml -- --json --capabilities
如果需要从共享解码 IR 导出结构化 JSON,请运行:
cargo run --manifest-path robustone/Cargo.toml -- --json riscv32 93001000
从仓库根目录运行完整的回归测试套件:
此命令会:
其他常用验证命令:
python3 test/run_tests.py --list python3 test/run_tests.py --arch riscv32 --limit 20 --verbose cargo test --workspace --all-features cargo run --manifest-path robustone/Cargo.toml -- --json riscv32 93001000
以上命令已于 2026-03-20 在本地验证通过。
.github/workflows/ci.yml
tests/differential/known-differences.toml
docs/isa-checklist.md
docs/benchmark-baselines.md
docs/release-checklist.md
docs/versioning-policy.md
test/README.md
我们欢迎贡献。请阅读 CONTRIBUTING_CN.md 了解以下内容:
Rewrite Capstone in Rust
Robustone
Robustone 是由华中科技大学开源原子俱乐部用 Rust 编写的实验性反汇编引擎。受 Capstone 项目启发,它探索如何利用 Rust 强大的安全保证来提供与 Capstone 兼容的体验,同时拥有更清洁的代码库和现代化的工具链。
兼容性边界
Robustone 将与 Capstone 的兼容目标拆分为三层:
cstool接近的命令行体验,包括arch+mode语法、原始十六进制输入和细节输出选项。当前仓库状态:
riscv、riscv32、riscv64docs/support-matrix.md0.0.0范围:面向 RISC-V 主线的实验版,而不是多 ISA 的 Capstone 替代品系统要求
git和基本构建工具(用于获取 Capstone 参考实现)。项目结构
快速开始
克隆仓库(包括子模块,如果有的话)并安装上述工具链要求。捆绑的
Makefile为常见工作流程提供了快捷方式:make buildmake checkrustfmt、clippy、black、pylint)。make formatmake runcargo run相同的参数)。make testmake test-quickmake helptest目标在首次使用时会将 Capstone 下载到third_party/capstone,通过test/scripts/build_cstool.sh构建比较工具,运行python3 test/run_tests.py --all,最后执行cargo test --workspace --all-features。运行 CLI
当前已实现的 RISC-V 后端尽量镜像经典
cstool的使用方式。例如,要解码一条 RISC-V 指令并显示详细信息:十六进制输入遵循
cstool约定,按内存中的原始字节顺序解释。或者,您可以使用
RUN_ARGS变量。这样可以防止make错误解析-d等标志:如果需要查看当前 CLI 暴露的完整参数面,请运行:
如果需要直接查看共享能力注册表导出的支持面,请运行:
如果需要从共享解码 IR 导出结构化 JSON,请运行:
测试
从仓库根目录运行完整的回归测试套件:
此命令会:
third_party/capstone下可用(如有必要会克隆仓库)。test/scripts/build_cstool.sh构建 Capstone 的cstool辅助工具。python3 test/run_tests.py --all。cargo test --workspace --all-features检查 Rust workspace 测试。其他常用验证命令:
以上命令已于 2026-03-20 在本地验证通过。
CI 与项目文档
.github/workflows/ci.yml(执行make check、cargo test --workspace --all-features、make test,并提供定时 fuzz smoke)docs/support-matrix.mdtests/differential/known-differences.tomldocs/isa-checklist.mddocs/benchmark-baselines.mddocs/release-checklist.mddocs/versioning-policy.mdtest/README.md贡献
我们欢迎贡献。请阅读 CONTRIBUTING_CN.md 了解以下内容: