From 796548e78c2a8ed997fc86114ec09f3b4469708c Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Sat, 15 Apr 2023 14:59:53 +0100 Subject: [PATCH] test: enable coverage of crit e2e tests Signed-off-by: Radostin Stoyanov --- crit/Makefile | 2 +- test/Makefile | 4 +++- test/crit/Makefile | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crit/Makefile b/crit/Makefile index f72082390..582d2b589 100644 --- a/crit/Makefile +++ b/crit/Makefile @@ -39,7 +39,7 @@ gen-proto: $(proto_files) bin/crit: cmd/cli.go - $(GO) build -o $@ $^ + $(GO) build ${GOFLAGS} -o $@ $^ ../test/loop/loop: ../test/loop/loop.c $(CC) $^ -o $@ diff --git a/test/Makefile b/test/Makefile index ec194acaf..a4cc90ca1 100644 --- a/test/Makefile +++ b/test/Makefile @@ -68,7 +68,8 @@ phaul/phaul.coverage: check-go-version phaul/*.go -o $@ phaul/main.go crit/crit-test.coverage: check-go-version crit/*.go - $(MAKE) -C ../crit bin/crit + $(MAKE) -C ../crit clean + $(MAKE) -C ../crit bin/crit GOFLAGS="-cover" $(MAKE) -C crit/ test-imgs $(GO) build \ -cover \ @@ -89,6 +90,7 @@ coverage: check-go-version $(COVERAGE_BINARIES) $(TEST_PAYLOAD) } cd crit/ && GOCOVERDIR=${COVERAGE_PATH} ./crit-test.coverage $(MAKE) -C ../crit/ unit-test GOFLAGS="-coverprofile=${COVERAGE_PATH}/coverprofile-crit-unit-test" + $(MAKE) -C crit/ e2e-test GOCOVERDIR=${COVERAGE_PATH} $(MAKE) -C crit/ clean # Print coverage from this run $(GO) tool covdata percent -i=${COVERAGE_PATH} diff --git a/test/crit/Makefile b/test/crit/Makefile index 9f32d8d46..fa3cfb7bd 100644 --- a/test/crit/Makefile +++ b/test/crit/Makefile @@ -20,7 +20,7 @@ test-imgs: ../loop/loop pkill -9 loop ../../crit/bin/crit: - $(MAKE) -C ../../crit bin/crit + $(MAKE) -C ../../crit bin/crit GOFLAGS="${GOFLAGS}" ../loop/loop: ../loop/loop.c $(CC) $^ -o $@