From 1743522b8a2d631db9444ac81e40f7c34f95a21e Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 6 Jun 2021 00:10:31 +0200 Subject: [PATCH] Add a local coverage target This needs lcov installed, but it's a good quick helper for local runs. For history and pull requests, codecov keeps tracking. Also tweak in the process gitignore to clean the noise. --- .gitignore | 8 +++++++- Makefile | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 824c10c..0b038b1 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,10 @@ /mt /stinit /version.h -/mt-st-*.tar.gz +/mt-st-*.tar.gz* +/out/ +/mt.gcda +/mt.gcno +/stinit.gcda +/stinit.gcno +/coverage.info diff --git a/Makefile b/Makefile index 284f914..1610053 100644 --- a/Makefile +++ b/Makefile @@ -95,11 +95,20 @@ check: $(PROGS) echo Checking complete stinit parsing ( ./stinit -v -v -p -f stinit.def.examples 2>&1 | grep -q 'Mode 1 definition: scsi2logical=1 can-bsr=1 auto-lock=0 two-fms=0 drive-buffering=1 buffer-writes read-ahead=1 async-writes=1 can-partitions=0 fast-eom=1 blocksize=0 sili=1 timeout=900 long-timeout=14400 density=0x44 compression=0' ) +# This needs lcov installed, and it's useful for local testing. +coverage: clean + $(MAKE) CFLAGS=-coverage + $(MAKE) check + lcov --capture --directory . --no-external --output-file coverage.info + genhtml coverage.info --output-directory out + + release-tag: git tag -s -m 'Release version $(VERSION).' mt-st-$(VERSION) clean: rm -f *~ \#*\# *.o $(PROGS) version.h + rm -rf out reindent: clang-format -i mt.c stinit.c