This will automatically create the `builddir` directory and build **everything** **inside** it.
```
cd builddir
meson compile
```
Now you should find the cmp_tool executable in the folder.
### Release Build
If you want to build an optimized release build run:
```
meson build_relase_dir --buildtype=release
cd build_relase_dir
meson compile
```
You find the build executable in the `build_relase_dir` directory
### Cross-compiling to native Windows
To build the cmp_tool you can use the [Mingw-w64](https://www.mingw-w64.org).
Unfortunately, the cmp_tool does not support the Microsoft MSVC compiler. But with the Mingw-w64 GCC compiler, we can compile the cmp_tool for Windows. For this, you need the [Mingw-w64 tool chain](https://www.mingw-w64.org/downloads/). This also works on Linux and macOS. To compile for Windows, do this:
To run the unit tests you need the [c unit testing framework](https://sourceforge.net/projects/cunit/).
To run the integration tests you need the [pytest](https://docs.pytest.org/en/7.0.x/index.html) framework. The easiest way to install pytest is with `pip3`:
```
pip3 install pytest
```
### Run tests
First, cd in the build directory:
```
cd <nameofthebuilddirectory>
```
You can easily run the test of all the components:
```
meson test
```
To list all available tests:
```
meson test --list
```
Meson also supports running the tests under GDB. Just doing this:
```
meson test --gdb <testname>
```
### Producing a coverage report
First, configure the build with this command.
```
cd <nameofthebuilddirectory>
meson configure -Db_coverage=true
```
Then issue the following commands.
```
meson test
ninja coverage-html
```
The coverage report can be found in the `meson-logs/coveragereport` subdirectory.
## Documentation
### External dependencies
To generate the documentation you need the [Doxygen](https://www.doxygen.nl/index.html) program.
Optional you can install the "dot" tool from [graphviz](http://www.graphviz.org/) to generate more advanced diagrams and graphs.