CPP-AP 2.2.6
Command-line argument parser for C++20
Loading...
Searching...
No Matches
Dev Notes


Building and testing

Note:

The project uses doctest framework for unit testing, however it is already installed in the tests/external directory, so there is no need to install it sepparately.

Build the testing executable

cmake -B build -DBUILD_TESTS=ON
cd build
make # -j <n>

This will build the test executable run in the <project-root>/build/tests directory.

Run the tests

cd build
./tests/run # -ts=<test-suite-name>

Note:

Test suites in the project have the same names as the files they're in except for the test_extarnal_libs_config.cpp file which defines the test_doctest_config test suite.



Formatting

Note:

The project uses clang-format-18 which is natively available on the Ubuntu-24.04 LTS system.

If the llvm-18 toolchain isn't available on your system, the installation instructions can be found on the llvm apt page. After installing the toolchain run sudo apt install clang-format-18.

You can format the code manually using clang-format-18 or you can use the prepared python script:

python scripts/format.py

To inspect the all script's options and usage run:

python scripts/format.py --help

Note:

The script requires python >= 3.9



Documentation

Note:

You can view the online documentation for the latest version here.

To view the documentation for the previous versions use the following URL pattern:

https://spectral519.github.io/cpp-ap/<version>

Please keep in mind that the online documentation is available only for versions >= 2.2.5 - for older versions the documentation has to be built locally.

The documentation for this project can be generated using Doxygen, styled with a custom fork of the doxygen-awesome-css theme.

Prerequisites

  1. Ensure that Doxygen is installed on your system. If not, you can download it from the official website.
  2. The doxygen-awesome-ccs theme fork is included as a submodule within the project.

Generating the Documentation

To generate the documentation, run the following commands in your terminal:

cd <project-root>
doxygen Doxyfile

This should create a documentation directory containing the project's documentation in html format.

Note:

Markdown links to other files or sections and the GFM-style callouts might not be rendered properly in the Doxygen output. To fix these issues you can run the postprocessing script:

python3 scripts/postprocess_doxyhtml.py ./documentation

or you can view those documents by using the Related Pages section on the navigation bar.