diff --git a/Makefile b/Makefile index 27b73cf5..e18487cf 100644 --- a/Makefile +++ b/Makefile @@ -71,6 +71,7 @@ minimal: initrd dist/artifacts/vmlinuz iso: dist/artifacts/rancheros.iso dist/artifacts/iso-checksums.txt test: minimal + ./scripts/unit-test cd tests/integration && HOST_ARCH=$(HOST_ARCH) ARCH=$(ARCH) tox .PHONY: all minimal initrd iso installer test diff --git a/scripts/unit-test b/scripts/unit-test new file mode 100755 index 00000000..6e8e1ab9 --- /dev/null +++ b/scripts/unit-test @@ -0,0 +1,8 @@ +#!/bin/bash +set -e + +cd $(dirname $0)/.. + +PACKAGES="$(find -name '*.go' | xargs -I{} dirname {} | cut -f2 -d/ | sort -u | grep -Ev '(^\.$|.git|.trash-cache|vendor)' | sed -e 's!^!./!' -e 's!$!/...!')" + +go test -race -cover -tags=test $PACKAGES