aboutsummaryrefslogtreecommitdiffstats
path: root/capstone/suite/cstest/README.md
blob: a9880dadf6da6fb0dae1b1064461c11d94afce9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# 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](https://git.cryptomilk.org/projects/cmocka.git)

- Build Cmocka

```
cd cmocka_dir
mkdir build
cd build
cmake ..
make
sudo make isntall
```

## Build

- Build `cstest`

```
cd suite/cstest
make
```

## 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
```