Installation
This repository self provides Nix packages (both in optimized and debuggable states) via the Nix flake at the repository root.
You can of course build the project without Nix, but you must in this case make sure that all the required dependencies are usable in your environment.
Here is an example for setting up an iterative build & test workflow with coverage support.
You can enter such an environment with this command: nix-shell -A shell-cpp-it --arg doCoverage true
# we assume that some environment variables are set
# BAT_INSTALL_PREFIX defines where the library should be installed
# BATPROTOCOL_TEST_OUTPUT_PATH defines where the test output files should be written
# compile & install the C++ library
cd cpp
meson setup --prefix ${BAT_INSTALL_PREFIX} --buildtype debugoptimized -Db_coverage=true --wipe build
meson compile -C build
meson install -C build
# compile the C++ tests (assuming you are already in the cpp directory)
cd test
meson setup --buildtype debugoptimized build
meson compile -C build
# run the C++ tests (assuming you are in the cpp/test directory)
./build/batprotocol-cpp-test
# generate an html coverage report (assuming you are in the cpp directory)
ninja -C build coverage-html