Closed
Description
Testing Capstones disassembly results is possible via too many ways.
- Test binaries print (but not test!) the values of instruction detail (e.g. which operands are written and read etc.).
MC
tests taken from LLVMs MC test files (insuite/MC
). They only test the disassembly of bytes to their assembly strings. To test those a:
- Python script exists
- And the
cstest
binary.
- Issue tests (files which name is
issue.cs
). They look very similar to the MC tests, but are not related. They can test detail information as well.cstest
processes them.
This is very confusing and could be unified.
I propose to:
- Get rid of the
test_<arch>
binaries, because they hard code every test. - Get rid of the Python scripts. Because they are a duplicate of
cstest
. - Rewrite
cstest
cstest
cstest
should be written from scratch. It needs modernization anyway (e.g. remove global variables) and we could settle on a single test file format.
This new format should support simple bytes <-> assembly string
testing, as well as testing the content of cs_detail
.
Once this is done we can also write scripts to translate LLVMs MC regression tests to our file format.
Before the v6
release we should also test every possible detail
setting for correctness. See #1984 (comment)
CI
- Test build of bindings and their correct working.
- Test build with
-DCAPSTONE_DIET
- Add Coverty scans (Setup Coverity GitHub Action #2029)
- Test all additional features like skipping bytes (see bugs like: skipdata doesn't work correctly from python #2336)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done