# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8
inherit go-module

DESCRIPTION="'go test' runner with output optimized for humans"
HOMEPAGE="https://github.com/gotestyourself/gotestsum"
SRC_URI="https://github.com/gotestyourself/gotestsum/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" https://share.terinstock.com/${P}-deps.tar.xz "

LICENSE="Apache-2.0"
BDEPEND=">=dev-lang/go-1.13"

SLOT="0"
KEYWORDS="~amd64"
# TODO: fix test failure with deps tarball
RESTRICT+=" test"

src_compile() {
	ego build -trimpath .
}

src_test() {
	go test -work "./..." || die
}

src_install() {
	dobin gotestsum
}