# HG changeset patch # User Mike Becker # Date 1703693994 -3600 # Node ID 4fd4e0c6107a2e7b5441bf888838cd71572ef934 # Parent bbf2f18b381893aae2d7663ba853ddf3987e4693 add make target to automatically gather coverage info diff -r bbf2f18b3818 -r 4fd4e0c6107a Makefile --- 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) diff -r bbf2f18b3818 -r 4fd4e0c6107a src/Makefile --- 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) $@ $^