FreeRTOS-Kernel/FreeRTOS/Test/CMock/subdir.mk
Paul Bartell d7e5f40885
Clean up CMock makefiles and add coverage filtering (#523)
* Cleanup Makefiles

* Add lcovrc configuration file

* Add CMock test build directory to .gitignore

* Add callgraph.py and filtercov.py scripts

* Cleanup list Makefile and update list_utest.c with coverage tags

* Add information about coverage filtering and running single test cases

* Remove -fprofile-exclude-files for compatibility with older versions of gcc.
Fix line endings (change to unix style)

* Lint callgraph.py and filtercov.py. Print and error when no target functions are defined.

* Indent with spaces when possible

* Replace tabs with spaces and enable .RECIPEPREFIX

* Add fake_port.h and related portmacro.h changes

* Fix list makefile when bin directory is not available

* Clean up grouped rules

* Update makesfile.. Add "two_tests" example dir

* Fix memory checker error

* Move common makefile items to subdir.mk and testdir.mk includes

* Update core_checker.py exclusions

* Remove line from portmacro.h that doesn't match core_checker.py
2021-03-15 17:01:29 -07:00

46 lines
1.2 KiB
Makefile

# Indent with spaces
.RECIPEPREFIX := $(.RECIPEPREFIX) $(.RECIPEPREFIX)
# Define directory paths
SCRATCH_DIR := $(GENERATED_DIR)/$(PROJECT)
LCOV_LIST := $(foreach suite,$(SUITES),$(SCRATCH_DIR)/$(PROJECT)_$(suite).info)
COVINFO := $(GENERATED_DIR)/$(PROJECT).info
COV_REPORT_DIR := $(SCRATCH_DIR)/coverage
.PHONY: all clean libs run bin lcov zerocoverage lcovhtml
all: run
clean:
rm -rf $(SCRATCH_DIR)
rm -f $(BIN_DIR)/$(PROJECT)*_utest
rm -f $(COVINFO)
libs:
make -C $(UT_ROOT_DIR) libs
lcov : $(COVINFO)
# run each suite and leave gcda / gcov files in place
run: libs
$(foreach suite,$(SUITES),\
make -C $(suite) run;)
bin: $(EXEC_LIST)
zerocoverage:
$(LCOV_BIN_DIR)/lcov --zerocounters --directory $(SCRATCH_DIR)
# Generate lcov for each suite
$(LCOV_LIST) :
$(foreach suite,$(SUITES),\
make -C $(suite) lcov;)
# Combine lcov from each subdirectory into one lcov info file for the project
$(COVINFO) : $(LCOV_LIST)
lcov $(LCOV_OPTS) -o $@ $(foreach cov,$(LCOV_LIST),--add-tracefile $(cov) )
lcovhtml : $(COVINFO)
mkdir -p $(COV_REPORT_DIR)
genhtml $(COVINFO) $(LCOV_OPTS) --output-directory $(COV_REPORT_DIR)