DEVP_GOTESTSUM_VERSION = v1.13.0
DEVP_GOTESTSUM_DIR = ${DEVP_TOOLS_ROOT}/gotestsum/${DEVP_GOTESTSUM_VERSION}
DEVP_GOTESTSUM_EXE = ${DEVP_GOTESTSUM_DIR}/gotestsum

${DEVP_GOTESTSUM_EXE}:
ifdef DEVP_NO_INSTALL
ifneq ($(DEVP_VERSION),$(DEVP_CI_BUILDER_VERSION))
	$(call error_message,"Platform version is [${DEVP_VERSION}] image version is [${DEVP_CI_BUILDER_VERSION}]. Same version is expected. Updating with [make devp/update] might help. DEVP_NO_INSTALL == 1. See: https://mws.pages.mws-team.ru/devp/platform-go-tools/pgt/user/pages/platform-update.html")
	@exit 1
endif
	$(call error_message,"[gotestsum] is expected to be installed but it is not. Please contact /duty golang for support.")
	@exit 1
endif
	$(Q) mkdir -p ${DEVP_GOTESTSUM_DIR}
	$(Q) CGO_ENABLED=0 GOBIN=${DEVP_GOTESTSUM_DIR} go install gotest.tools/gotestsum@${DEVP_GOTESTSUM_VERSION}
	$(call green,"gotestsum installed as $@")

.PHONY: devp/install/gotestsum
devp/install/gotestsum: ${DEVP_GOTESTSUM_EXE}
	@# Install gotestsum - v1.13.0

DEVP_JUNIT := ${DEVP_BUILD}/junit
DEVP_JUNIT_TESTSUM := ${DEVP_JUNIT}/gotestsum.xml
DEVP_GOTESTSUM_CMD := mkdir -p ${DEVP_JUNIT} && ${DEVP_GOTESTSUM_EXE} --junitfile ${DEVP_JUNIT_TESTSUM} -- -race -coverprofile=${DEVP_BUILD}/coverage.out ./...
