Developer guide

Build and run tests

In the main repository, do

mkdir build && cd build
cmake ..
make build-tests
ctest

The following cmake options can be used:

  • -DCMAKE_BUILD_TYPE=Debug for running tests in debug mode.

  • -DHTOOL_WITH_STRICT_TESTS=ON to use warnings as errors.

  • -DUSE_SANITIZER=Address to use the address sanitizer.

  • -DCODE_COVERAGE to activate code coverage.

Formatting

After configuring CMake as in Build and run tests, one can use the following targets:

make format
make cmake-format
  • format applies formatting to C++ code and requires ClangFormat.

  • cmake-format applies formatting to CMake files and requires Python and the package cmakelang.

Formatting options are configured respectively in .clang-format and cmake-format.py.

Build Doxygen documentation

Similar to Build and run tests, with cmake option -DHTOOL_WITH_DOC=ON and make doc.