Skip to content

Commit

Permalink
ADD: added coverage target to makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
drveles committed Jul 6, 2024
1 parent 5049790 commit 5eeeb72
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ build/
.vscode/
*.gcda
*.gcno
*.info
report/

# Prerequisites
*.d
Expand Down
22 changes: 16 additions & 6 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 5eeeb72

Please sign in to comment.