capstone/suite/cstest
Rot127 0a67596f70
Add test with ASAN enabled. (#2313)
* Add test with ASAN enabled.

* Fix leaks in cstool and cs.c

* Add work around so ASAN binaries don't DEADSIGNAL due to too many randomized address bits.

* Add ASAN build arguments to cstest

* Fix leaks in cstest

* Use cstest binary build by the main build.

* Add clonging step for cmocka when cstest is build

* Skip Python tests for ASAN

* Remove make build from CI

* Fix leaks in cstest.

- Rewrite split to remove leaks and improve runtime by 6%
- Add free()

* Fix cmocka external project to stable branch.

* Revert "Fix leaks in cstest."

This reverts commit bf8ee125b0c58f9c794eb081a69c80f8a71825cd.

* Fix memleaks in cstest

* Document adding of ASAN job to release guide

* Add CAPSTONE_BUILD_CSTEST to build docs

* Fix double free

* Add more detail tests to CI and fix them

* Initialize variables

* Fix typo

* Update cstest build docs

* Revert "Remove make build from CI"

This reverts commit 84f7360c6da6183cd41bec0fef3e1d0a2ee49ddf.

* Make cstest only run for cmake builds.

* Add cstest job for make build.

* Add CAPSTONE_DIET build test.

* Compile the compatibility header test with ASAN if enabled.

* Fix DIET build by excluding not used code.

* Missing "

* Build static library with ASAN and DIET if enabled.

* Revert "Add CAPSTONE_DIET build test."

This reverts commit 71e1469dee53bfdb6b275dd1be19f6eb21a0c023.
2024-06-10 10:01:00 +08:00
..
include Add test with ASAN enabled. (#2313) 2024-06-10 10:01:00 +08:00
src Add test with ASAN enabled. (#2313) 2024-06-10 10:01:00 +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
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 Fix #2244: The offset for pseudo-instr. IDs was incorrectly applied for vcmp. (#2331) 2024-05-08 22:25:14 +08:00

README.md

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