Created By: Michael Wrona
A collection of math utilities for MicWro Engineering projects.
sudo apt-get update
sudo apt-get install -y build-essential cmake lcov gdb
This project gets compiled into a shared library libmathutils.so
.
# Create a build folder at the top-level of the repo.
mkdir build/
cd build/
# Here are a few cmake build commands for the project
cmake .. # automatically builds in debug mode
cmake .. -DCMAKE_BUILD_TYPE=Debug # explicitly debug build
cmake .. -DCMAKE_BUILD_TYPE=Release # release build
# compile
make -j
VS Code build tasks are configured for this project. They can be run with CTRL+SHIFT+B
. Select between debug and release builds.
Unit tests created with Google Test are included in the project.
cd build/
cmake .. && make -j
ctest
Generate a lcov
code coverage report with the following commands. NOTE: be sure to Debug
build and run all tests.
lcov --base-directory $(pwd) --directory $(pwd)/../ --capture --output-file coverage-results.info &&\
# run tests (debug built)
cd build/
ctest
# generate lcov report
cd ../
lcov --base-directory $(pwd) --directory $(pwd)/../ --capture --output-file coverage-results.info &&\
lcov --remove coverage-results.info '/usr/*' '*/gtest/*' --output-file coverage-results-cleaned.info &&\
genhtml -o coverage-html coverage-results-cleaned.info --legend --title "MathUtils Test Coverage"
The code repo can be found here.
git clone https://github.com/michaelwro/math-utils.git