CppML
provides tests
for each of its components, which are automatically built with Github Actions
on each push.
Because CppML
is a metalanguage, all computations expressed in it happen at compile time. This means that all the tests are static
, and if the they compile, they have been passed.
The tests are located in the test/src
directory, and follow the same structure as the include/CppML
:
- the tests for each library have an associated file
.cpp
and a directory of the same name in thetest/src/
directory. For example, the tests for theAlgorithm
library have anAlgorithm.cpp
file located in thetest/src
. - every component of each library has a dedicated
.hpp
test header inside the libraries associated test directory. For example,Sort
, a component of theAlgorithm
library, has a header located attest/src/Algorithm/Sort.hpp
.
Each library defines a target named CppML_<LIBRARY>_TEST
, where <LIBRARY
> is the name of library in question.
To build the tests configure the project with -DBUILD_TESTS=True
, which means:
mkdir build && cd build;
cmake .. -DBUILD_TESTS=True
make
If the build succeeds, the test have been passed.