mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
Building Tests

Build tests on demand (always available, even if MXLIB_BUILD_TESTS=OFF):

cmake -S . -B _build
cmake --build _build --target tests -j

Configure with tests enabled:

cmake -S . -B _build -DMXLIB_BUILD_TESTS=ON

With MXLIB_BUILD_TESTS=ON, test executables are part of the default build. With MXLIB_BUILD_TESTS=OFF, they are skipped by default and built only via tests/mxlibTests targets.

Build all test executables:

cmake --build _build --target mxlibTests -j

Run tests:

ctest --test-dir _build --output-on-failure

Run the CTest test suite directly:

cmake --build _build --target mxlibTestRun

Build and run a single test source (Makefile.one equivalent):

cmake -S . -B _build -DMXLIB_BUILD_TESTS=ON -DMXLIB_ONE_TEST=include/math/geo_test.cpp
cmake --build _build --target mxlibTestOne -j
cmake --build _build --target mxlibTestOneRun

Coverage generation is integrated into CMake and modeled after the MagAOX flow.

Prerequisites:

lcov --version
genhtml --version

Generate an HTML coverage report:

cmake -S . -B _build
cmake --build _build --target coverage

Build Doxygen docs directly from CMake:

cmake --build _build --target docs

Optionally include docs in the default build:

cmake -S . -B _build -DMXLIB_BUILD_DOCS=ON

Optional: tune coverage test timeout (default 300 seconds):

cmake -S . -B _build -DMXLIB_COVERAGE_TEST_TIMEOUT=600

Coverage artifacts are written under _build/:

Clean coverage artifacts:

cmake --build _build --target coverage_clean

Convenience scripts are also available: