Skip to content

Commit

Permalink
Clean up the cstest documentation and build instructions. (#2580)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 authored Dec 15, 2024
1 parent 4dc14ba commit 2c4b05f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
11 changes: 11 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,14 @@ X86_REDUCE, run "cmake" with: `-DCAPSTONE_USE_SYS_DYN_MEM=0`, `-DCAPSTONE_BUILD_
- `ENABLE_ASAN`: Compiles Capstone with the address sanitizer.
- `ENABLE_COVERAGE`: Generate coverage files.
- `CAPSTONE_BUILD_LEGACY_TESTS`: Build some legacy integration tests.

## Building cstest

`cstest` is build together with Capstone by adding the flag `-DCAPSTONE_BUILD_CSTEST`.

The build requires `libyaml`. It is a fairly common package and should be provided by your package manager.

_Note:_ Currently `cstest` us only supported on Linux.

If you run another operation system, please install `cstest_py`.
See `bindings/python/BUILDING.md` for instructions.
14 changes: 13 additions & 1 deletion bindings/python/BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,19 @@
pip install bindings/python/
```

2. The tests directory contains some test code to show how to use the Capstone API.
2. Building cstest_py

To run the disassembler tests you can install `cstest_py` as alternative to the normal `cstest`.
In contrast to `cstest`, `cstest_py` also runs on Windows and Mac.

Install with:
```
pip install bindings/python/cstest_py/
```

It requires the bindings of course.

3. The tests directory contains some test code to show how to use the Capstone API.

- test_lite.py
Similarly to test_basic.py, but this code shows how to use disasm_lite(), a lighter
Expand Down
10 changes: 1 addition & 9 deletions suite/cstest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,6 @@ Copyright © 2024 Rot127 <unisono@quyllur.org>
SPDX-License-Identifier: BSD-3
-->

## Building

`cstest` is build together with Capstone by adding the flag `-DCAPSTONE_BUILD_CSTEST`.

The build requires `libyaml`. It is a fairly common package and should be provided by your package manager.

## Testing
## Testing cstest

Files to test `cstest` itself are located in `suite/cstest/test`.
And yes, testing with a shell script is not nice. But I have time constraints, and
for integration testing it does pretty much exactly what it should.

0 comments on commit 2c4b05f

Please sign in to comment.