From 5eeeb724f6bd78932b703a1cf7c1d5ca3c6c765c Mon Sep 17 00:00:00 2001 From: jenniffr Date: Sat, 6 Jul 2024 18:48:21 +0300 Subject: [PATCH] ADD: added coverage target to makefile --- .gitignore | 2 ++ src/Makefile | 22 ++++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 960e919..c16b260 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ build/ .vscode/ *.gcda *.gcno +*.info +report/ # Prerequisites *.d diff --git a/src/Makefile b/src/Makefile index 774b8c5..89fd090 100644 --- a/src/Makefile +++ b/src/Makefile @@ -16,27 +16,37 @@ install: uninstall uninstall: clean -@rm -rf build/ ../Calculator_1.app/ @echo "======================================" - @echo "===========> UNINSATLLED <============" + @echo "===========> UNINSTALLED <============" @echo "======================================" clean: - -@rm -rf *.out *.gcno *.gcda *.dSYM/ *.o + -@rm -rf *.out *.gcno *.gcda *.dSYM/ *.o ../*.tar ./report *info dvi: - $(OPEN_COMAND) ../README.md + open ./../README.md dist: clean - @mkdir SmartCalc_v2.0 - @mkdir SmartCalc_v2.0/src - @cp -r front functions tests Makefile s21_calc_controller.* SmartCalc_v2.0/src/ + @mkdir -p SmartCalc_v2.0 + @mkdir -p SmartCalc_v2.0/src + @cp -r ./* SmartCalc_v2.0/src @cp ../README.md SmartCalc_v2.0/ @tar -cf SmartCalc_v2.0.tar SmartCalc_v2.0 @rm -rf SmartCalc_v2.0/ + @mv ./SmartCalc_v2.0.tar ../. + @echo "======================================" + @echo "===========> DIST READY <=============" + @echo "======================================" test: clean google_format $(CC) $(CC_FLAGS) ./tests/tests.cpp ./model/model.cpp -o a.out $(CC_TEST_FLAGS) ./a.out +gcov_report: test + @lcov -t "Tests" -o tests.info -c -d . --ignore-errors inconsistent >/dev/null 2>&1 + @lcov -e tests.info '*.cpp' -o tests.info >/dev/null 2>&1 + @genhtml -o report tests.info >/dev/null 2>&1 + open ./report/index.html + leaks: test CK_FORK=no leaks -atExit -q -- ./a.out