capstone/suite/cstest
wxrdnx 404912f068
Add access support for RISC-V (#2393)
* resolve conflict for loongarch and RISCV in Mapping.c and Mapping.h

* Use RISCV_get_detail for simplicity

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>

* Use detail_is_set for simplicity

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>

* Change comment style

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>

* remove redundant add_str

* fix bug for RISCV_add_detail

* fix operands for csr instructions

* add python binding and tester for RISC-V

* add more test cases for RISC-V (M,A,F,D,C instructions)

* fix incorrect operand and access for sc.w and sc.d

* fix incorrect operand for fence and sfence.vma

* assert -> CS_ASSERT

* some instructions in test_riscv.c should be RISCV64

* add cs details test

* update python testers

---------

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>
2024-07-10 11:36:39 +08:00
..
include Initial auto-sync LoongArch support (#2349) 2024-06-26 14:47:44 +08:00
src Add access support for RISC-V (#2393) 2024-07-10 11:36:39 +08:00
build_cstest.sh Add test with ASAN enabled. (#2313) 2024-06-10 10:01:00 +08:00
cstest_report.py Add test with ASAN enabled. (#2313) 2024-06-10 10:01:00 +08:00
issues.cs AArch64 update to LLVM 18 (#2298) 2024-07-08 10:28:54 +08:00
Makefile Add test with ASAN enabled. (#2313) 2024-06-10 10:01:00 +08:00
README.md Add test with ASAN enabled. (#2313) 2024-06-10 10:01:00 +08:00

Regression testing

This directory contains a tool for regression testing core of Capstone

Dependency

  • MacOS users can install cmocka with:
brew install cmocka
  • Or download & build from source code Cmocka

  • Build Cmocka

Build

You can build cstest with cmake when building Capstone. Just pass the CAPSTONE_BUILD_CSTEST flag during configuration.

Alternatively you can use the build_cstest.sh file in this directory.

Usage

  • Usage: cstest [-e] [-f <file_name.cs>] [-d <directory>]

    • -e : test all commented test
  • Test for all closed issues

cd suite/cstest
./build/cstest -f ./issues.cs
  • Test for some input from LLVM
cd suite/cstest
./build/cstest -f ../MC/AArch64/basic-a64-instructions.s.cs
  • Test for all cs file in a folder
cd suite/cstest
./build/cstest -d ../MC
  • Test all
cd suite/cstest
make cstest

Report tool

  • Usage cstest_report.py [-Dc] -t <cstest_path> [-f <file_name.cs>] [-d <directory>]

    • -D : print details
    • -c : auto comment out failed test
  • Example:

./cstest_report.py -t build/cstest -d ../MC/PowerPC/
./cstest_report.py -t build/cstest -f issues.cs