claremacrae / approval-tests-setup

An example project using CMake's FetchContent with ApprovalTests.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

approval-tests-setup

An example project using CMake's FetchContent module with ApprovalTests. In addition also uses Meson build framework to build the same example.

Dependencies

A fairly recent version of CMake is required, at least 3.14. Git is also required for CMake to fetch other dependencies. Meson 0.50.0 have been used to test the meson build. This project defaults to using the C++11 standard and a compliant compiler is recommended.

Build

CMake

A standard CMake install should build this project. Please note that the Ninja generator is not supported by the ApprovalTests Catch2 integration. The test will fail if Ninja is used as the build generator. Otherwise, the following example code should build for any single-configuration generator.

mkdir build
cmake ..
cmake --build .

A multi-configuration generator must specify the configuration of the build. The following command specifies the Release configuration.

cmake --build . --config Release

Meson

You could use the meson_build.sh script or run the individual commands.

meson build_meson -Db_coverage=true
ninja -C build_meson
ninja -C build_meson test
ninja -C build_meson coverage-html

Run

The tests can be run by simply invoking CTest in the build directory.

ctest

Install

This project is not currently meant to be installed.

Open Source Software

This project is powered by open source projects šŸ„°

License

This project is licensed under the MIT license.

Authors

About

An example project using CMake's FetchContent with ApprovalTests.

License:MIT License


Languages

Language:CMake 40.8%Language:Meson 32.1%Language:C++ 19.8%Language:Shell 7.2%