2017-08-16 23:36:00 +00:00
|
|
|
#
|
|
|
|
# This is a project Makefile. It is assumed the directory this Makefile resides in is a
|
|
|
|
# project subdirectory.
|
|
|
|
#
|
|
|
|
|
|
|
|
PROJECT_NAME := gcov_example
|
|
|
|
|
|
|
|
include $(IDF_PATH)/make/project.mk
|
|
|
|
|
2019-03-14 08:54:04 +00:00
|
|
|
GCOV := $(call dequote,$(CONFIG_SDK_TOOLPREFIX))gcov
|
2017-08-16 23:36:00 +00:00
|
|
|
REPORT_DIR := $(BUILD_DIR_BASE)/coverage_report
|
|
|
|
|
2020-03-30 07:33:07 +00:00
|
|
|
pre-cov-report:
|
2017-08-16 23:36:00 +00:00
|
|
|
echo "Generating coverage report in: $(REPORT_DIR)"
|
|
|
|
echo "Using gcov: $(GCOV)"
|
|
|
|
mkdir -p $(REPORT_DIR)/html
|
2020-03-30 07:33:07 +00:00
|
|
|
|
|
|
|
lcov-report: | pre-cov-report
|
|
|
|
echo "WARNING: lcov-report is deprecated. Please use gcovr-report instead."
|
2017-08-16 23:36:00 +00:00
|
|
|
lcov --gcov-tool $(GCOV) -c -d $(BUILD_DIR_BASE) -o $(REPORT_DIR)/$(PROJECT_NAME).info
|
|
|
|
genhtml -o $(REPORT_DIR)/html $(REPORT_DIR)/$(PROJECT_NAME).info
|
|
|
|
|
2020-03-30 07:33:07 +00:00
|
|
|
gcovr-report: | check_python_dependencies pre-cov-report
|
|
|
|
cd $(BUILD_DIR_BASE)
|
|
|
|
gcovr -r $(PROJECT_PATH) --gcov-executable $(GCOV) -s --html-details $(REPORT_DIR)/html/index.html
|
|
|
|
|
2017-08-16 23:36:00 +00:00
|
|
|
cov-data-clean:
|
|
|
|
echo "Remove coverage data files..."
|
|
|
|
find $(BUILD_DIR_BASE) -name "*.gcda" -exec rm {} +
|
|
|
|
rm -rf $(REPORT_DIR)
|
|
|
|
|
2020-03-30 07:33:07 +00:00
|
|
|
.PHONY: lcov-report gcovr-report cov-data-clean
|