#!/bin/bash
if [ -d build ] ; then
	rm -fr build
fi
if [ -d gcovr-report ] ; then
	rm -fr gcovr-report
fi
cmake -S . -B build -Wno-dev 
cmake --build build
cd build
ctest --output-on-failure
cd ..
mkdir gcovr-report
#lcov --capture --directory ./ --output-file lcoverage/main_coverage.info
#lcov --remove lcoverage/main_coverage.info 'v1/*' '/Applications/*' '*/tests/*' --output-file lcoverage/main_coverage.info -q
#lcov --list lcoverage/main_coverage.info
cd ..
gcovr  --gcov-filter "CPPFImdlp.cpp" --gcov-filter "Metrics.cpp" --gcov-filter "BinDisc.cpp" --txt --sonarqube=tests/gcovr-report/coverage.xml --exclude-noncode-lines
