From 573788739bb34d0690b4c21c5811208045175f5d Mon Sep 17 00:00:00 2001 From: Roman Zajic Date: Tue, 30 Jan 2024 19:55:26 +0800 Subject: [PATCH] chore: add coverage target to Makefile (#2382) --- Makefile | 6 +++++- scripts/run_cov.sh | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index dfc0b6f439..520d720ea5 100644 --- a/Makefile +++ b/Makefile @@ -206,13 +206,17 @@ networkmonitor: | build deps librln ################### ## Documentation ## ################### -.PHONY: docs +.PHONY: docs coverage # TODO: Remove unused target docs: | build deps echo -e $(BUILD_MSG) "build/$@" && \ $(ENV_SCRIPT) nim doc --run --index:on --project --out:.gh-pages waku/waku.nim waku.nims +coverage: + echo -e $(BUILD_MSG) "build/$@" && \ + $(ENV_SCRIPT) ./scripts/run_cov.sh -y + ##################### ## Container image ## diff --git a/scripts/run_cov.sh b/scripts/run_cov.sh index 0c496c7142..a95739f4e5 100755 --- a/scripts/run_cov.sh +++ b/scripts/run_cov.sh @@ -22,7 +22,7 @@ SCRIPT_PATH=$(dirname "$(realpath -s "$0")") REPO_ROOT=$(dirname $SCRIPT_PATH) generated_not_to_break_here="$REPO_ROOT/generated_not_to_break_here" -if [ -f $generated_not_to_break_here ] +if [ "$1" != "-y" ] && [ -f "$generated_not_to_break_here" ] then echo "The file '$generated_not_to_break_here' already exists. Do you want to continue? (y/n)" read -r response