diff --git a/Makefile b/Makefile index e3bfd3187..17788b68c 100644 --- a/Makefile +++ b/Makefile @@ -90,7 +90,10 @@ build.common: @$(MAKE) go.validate do.build.platform.%: - @$(MAKE) GOOS=$(word 1, $(subst _, ,$*)) GOARCH=$(word 2, $(subst _, ,$*)) go.build + @$(MAKE) PLATFORM=$* go.build +ifeq ($(BUILD_INTEGRATION_TESTS),1) + @$(MAKE) PLATFORM=$* go.build.integration.test +endif do.build.parallel: $(foreach p,$(PLATFORMS), do.build.platform.$(p)) diff --git a/build/makelib/golang.mk b/build/makelib/golang.mk index 6b20eddd4..5f1de724c 100644 --- a/build/makelib/golang.mk +++ b/build/makelib/golang.mk @@ -122,7 +122,6 @@ go.install.packages.$(1): @$(3) $(GO) install -v $(4) $(2) go.install.packages: go.install.packages.$(1) endef - $(foreach p,$(GO_STATIC_PACKAGES),$(eval $(call go.project,$(lastword $(subst /, ,$(p))),$(p),CGO_ENABLED=0,$(GO_STATIC_FLAGS)))) .PHONY: go.build @@ -133,7 +132,7 @@ go.build: go.install: @$(MAKE) go.install.packages -.PHONY: +.PHONY: go.test.unit go.test.unit: $(GOJUNIT) @echo === go test unit-tests @mkdir -p $(GO_TEST_OUTPUT) @@ -141,6 +140,11 @@ go.test.unit: $(GOJUNIT) @CGO_ENABLED=0 $(GOHOST) test -v -cover $(GO_TEST_FLAGS) $(GO_STATIC_FLAGS) $(GO_PACKAGES) 2>&1 | tee $(GO_TEST_OUTPUT)/unit-tests.log @cat $(GO_TEST_OUTPUT)/unit-tests.log | $(GOJUNIT) -set-exit-code > $(GO_TEST_OUTPUT)/unit-tests.xml +.PHONY: go.build.integration.test +go.build.integration.test: + @echo === go build integration test packages $(PLATFORM) + @CGO_ENABLED=0 $(GOHOST) test -v -i $(GO_STATIC_FLAGS) -c -o $(GO_OUT_DIR)/test.integration $(GO_INTEGRATION_TEST_PACKAGES) + .PHONY: go.test.integration: $(GOJUNIT) @echo === go test integration-tests