mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
chasquid-util: Include in coverage tests
This patch adds chasquid-util command-line to the coverage tests, so it is easier to identify testing gaps.
This commit is contained in:
@@ -1,8 +1,4 @@
|
|||||||
// chasquid-util is a command-line utility for chasquid-related operations.
|
// chasquid-util is a command-line utility for chasquid-related operations.
|
||||||
//
|
|
||||||
// Don't include it in the coverage build.
|
|
||||||
//go:build !coverage
|
|
||||||
// +build !coverage
|
|
||||||
|
|
||||||
package main
|
package main
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,12 @@ set -e
|
|||||||
|
|
||||||
init
|
init
|
||||||
|
|
||||||
go build || exit 1
|
if [ "${GOCOVERDIR}" != "" ]; then
|
||||||
|
GOFLAGS="-cover -covermode=count -o chasquid-util $GOFLAGS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# shellcheck disable=SC2086
|
||||||
|
go build $GOFLAGS -tags="$GOTAGS" .
|
||||||
|
|
||||||
function r() {
|
function r() {
|
||||||
./chasquid-util -C=.config "$@"
|
./chasquid-util -C=.config "$@"
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ GOCOVERDIR="${COVER_DIR}/sh" setsid -w ./test/run.sh
|
|||||||
echo "dovecot cli ..."
|
echo "dovecot cli ..."
|
||||||
GOCOVERDIR="${COVER_DIR}/sh" setsid -w ./cmd/dovecot-auth-cli/test.sh
|
GOCOVERDIR="${COVER_DIR}/sh" setsid -w ./cmd/dovecot-auth-cli/test.sh
|
||||||
|
|
||||||
|
echo "chasquid-util ..."
|
||||||
|
GOCOVERDIR="${COVER_DIR}/sh" setsid -w ./cmd/chasquid-util/test.sh
|
||||||
|
|
||||||
# Merge all coverage output into a single file.
|
# Merge all coverage output into a single file.
|
||||||
go tool covdata merge -i "${COVER_DIR}/go,${COVER_DIR}/sh" -o "${COVER_DIR}/all"
|
go tool covdata merge -i "${COVER_DIR}/go,${COVER_DIR}/sh" -o "${COVER_DIR}/all"
|
||||||
go tool covdata textfmt -i "${COVER_DIR}/all" -o "${COVER_DIR}/merged.out"
|
go tool covdata textfmt -i "${COVER_DIR}/all" -o "${COVER_DIR}/merged.out"
|
||||||
|
|||||||
Reference in New Issue
Block a user