Wed, 27 Dec 2023 17:19:54 +0100
add make target to automatically gather coverage info
Makefile | file | annotate | diff | comparison | revisions | |
src/Makefile | file | annotate | diff | comparison | revisions |
--- a/Makefile Wed Dec 27 16:18:10 2023 +0100 +++ b/Makefile Wed Dec 27 17:19:54 2023 +0100 @@ -59,6 +59,10 @@ check: compile test-compile FORCE $(build_dir)/tests/ucxtest +check-coverage: FORCE + $(MAKE) -s check + @cd src && $(MAKE) check-coverage + test-compile: cd tests && $(MAKE)
--- a/src/Makefile Wed Dec 27 16:18:10 2023 +0100 +++ b/src/Makefile Wed Dec 27 17:19:54 2023 +0100 @@ -28,11 +28,21 @@ OBJ_EXT=.o OBJ=$(SRC:%.c=$(build_dir)/%$(OBJ_EXT)) +GCOV=$(SRC:%.c=%.c.gcov) static: $(build_dir)/libucx_static$(STLIB_EXT) shared: $(build_dir)/libucx$(SHLIB_EXT) +check-coverage: $(GCOV) + mv *.gcov "$(build_dir)" + +%.c.gcov: %.c $(build_dir)/%.gcno + gcov -Ho "$(build_dir)" $< + +$(build_dir)/%.gcno: + test -f "$@" + $(build_dir)/libucx_static$(STLIB_EXT): $(OBJ) $(AR) $(ARFLAGS) $@ $^