From 6e50908c34fd59e7d605f57a26fe8affe58e7788 Mon Sep 17 00:00:00 2001 From: gwei3 <11015100@qq.com> Date: Sat, 9 Oct 2021 16:43:47 +0800 Subject: [PATCH] update Makefiles to provide completed build & test --- attestation/Makefile | 4 ++-- attestation/rac/Makefile | 11 ++++++++--- attestation/ras/Makefile | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/attestation/Makefile b/attestation/Makefile index 38ba13b..4addc78 100644 --- a/attestation/Makefile +++ b/attestation/Makefile @@ -3,7 +3,7 @@ subdir = ras rac .PHONY: all build test clean install check all build test clean install check: - for name in $(subdir); do \ - make -C $$name $@;\ + for name in $(subdir); do\ + make -C $$name $@ || exit $$?;\ done diff --git a/attestation/rac/Makefile b/attestation/rac/Makefile index bba0f67..e5c64a6 100644 --- a/attestation/rac/Makefile +++ b/attestation/rac/Makefile @@ -1,10 +1,12 @@ +TESTEES=./raagent ./ractools ./rahub ./tbprovisioner + all: build test: - @echo "to be completed" + go test $(TESTEES) -build: +build: vendor go build -mod=vendor -o pkg/raagent raagent/*.go go build -mod=vendor -o pkg/ractools ractools/*.go go build -mod=vendor -o pkg/tbprovisioner tbprovisioner/*.go @@ -19,4 +21,7 @@ install: check: $(shell go env GOPATH)/bin/golangci-lint run -e gofmt -e gocyclo -e errorlint -e gosec -.PHONY: all build test clean install check +vendor: + go mod vendor + +.PHONY: all build test clean install check vendor diff --git a/attestation/ras/Makefile b/attestation/ras/Makefile index b61bbf7..79b953e 100644 --- a/attestation/ras/Makefile +++ b/attestation/ras/Makefile @@ -1,9 +1,10 @@ PKGPATH = pkg +TESTEES = ./cache ./clientapi ./cmd/ras ./config ./dao ./entity ./pca ./restapi ./trustmgr ./verifier all: build test: - @echo "to be completed" + go test $(TESTEES) build: vendor go build -mod=vendor -o $(PKGPATH)/ras cmd/ras/*.go -- Gitee