From cbd6c45887a177bd9279ce9198da0712a6417248 Mon Sep 17 00:00:00 2001 From: TazyFoundSoup Date: Mon, 18 May 2026 10:31:15 +1000 Subject: ci(coverage): Add repo coverage with codecov --- Makefile | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index cca0169..1716671 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,7 @@ OUTDIR = build BENCH_OUT = $(OUTDIR)/bench LIB = libtinyff.a -ALL_CFLAGS = -Wall -Wextra -Werror -std=c11 -Iinclude +ALL_CFLAGS = -Wall -Wextra -Werror -std=c11 -Iinclude --coverage DEBUG_FLAGS = -g -O0 -fno-omit-frame-pointer RELEASE_FLAGS = -O2 @@ -37,7 +37,7 @@ $(OUTDIR)/%.o: %.c $(CC) $(ALL_CFLAGS) $(CFLAGS) -c $< -o $@ clean: - rm -rf $(OUTDIR) png_test + rm -rf $(OUTDIR) png_test coverage.info .coverage debug: CFLAGS = $(DEBUG_FLAGS) debug: $(OUTDIR)/$(LIB) @@ -63,4 +63,12 @@ bench: $(OUTDIR)/$(LIB) $(CC) $(ALL_CFLAGS) $(RELEASE_FLAGS) $(BENCH_SRC) -o $(BENCH_OUT)/bench -L$(OUTDIR) -ltinyff $(BENCH_OUT)/bench -.PHONY: all clean debug release asan test test-png gdb bench \ No newline at end of file +coverage: clean + $(MAKE) USE_HOSTED=1 debug + $(CC) $(ALL_CFLAGS) $(DEBUG_FLAGS) -DUSE_HOSTED tests/format/image/png/png_open.c -o $(OUTDIR)/png_test -L$(OUTDIR) -ltinyff + ./$(OUTDIR)/png_test || true + lcov --capture --directory . --output-file coverage.info + lcov --remove coverage.info '/usr/*' --output-file coverage.info --ignore-errors unused + lcov --list coverage.info + +.PHONY: all clean debug release asan test test-png gdb bench coverage \ No newline at end of file -- cgit v1.2.3