Skip to content

Commit

Permalink
test: enable coverage of crit e2e tests
Browse files Browse the repository at this point in the history
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
  • Loading branch information
rst0git committed Apr 15, 2023
1 parent adb3bef commit 796548e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
Expand Down
4 changes: 3 additions & 1 deletion test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion test/crit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@
Expand Down

0 comments on commit 796548e

Please sign in to comment.