From bd8123cb766a763b7699ae83c3d1b17e5746f842 Mon Sep 17 00:00:00 2001 From: Lion Kortlepel Date: Thu, 22 Jan 2026 23:19:18 +0100 Subject: ci: add coverage scripts --- scripts/Makefile-cov | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/Makefile-cov (limited to 'scripts/Makefile-cov') diff --git a/scripts/Makefile-cov b/scripts/Makefile-cov new file mode 100644 index 0000000..023d020 --- /dev/null +++ b/scripts/Makefile-cov @@ -0,0 +1,25 @@ +# Coverage makefile, DO NOT USE +# This file is mostly AI generated. + +CFLAGS=-fprofile-arcs -ftest-coverage -DNDEBUG -I. + +all: tests_cov_tmp + +tests_cov_tmp: ls_args.o tests/tests.c tests/ls_test.h + $(CC) -o $@ ls_args.o tests/tests.c -Itests -ggdb $(CFLAGS) + +ls_args.o: ls_args.h + echo -e "#include \nvoid* test_realloc(void*, size_t);" >.test.h + cat .test.h ls_args.h >.ls_args_test.c + $(CC) -c -x c -o $@ .ls_args_test.c -Wall -Wextra -Wpedantic -Werror -std=c89 -ggdb \ + -Wno-error=pragma-once-outside-header \ + -DLS_ARGS_IMPLEMENTATION \ + -DLS_REALLOC=test_realloc \ + -Wno-pragma-once-outside-header \ + $(CFLAGS) + +.PHONY: clean + +clean: + rm -f tests_cov_tmp + rm -f ls_args.o -- cgit