From 556892cf869340b982841da8a52eda90f7a5520a Mon Sep 17 00:00:00 2001 From: mmetc <92726601+mmetc@users.noreply.github.com> Date: Mon, 14 Feb 2022 22:21:19 +0100 Subject: [PATCH] make test (#1249) --- Makefile | 14 ++++++++++++-- cmd/crowdsec/Makefile | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a371d52e4..2f5556a71 100644 --- a/Makefile +++ b/Makefile @@ -61,6 +61,9 @@ LD_OPTS_VARS= \ export LD_OPTS=-ldflags "-s -w $(LD_OPTS_VARS)" export LD_OPTS_STATIC=-ldflags "-s -w $(LD_OPTS_VARS) -extldflags '-static'" +GOCMD=go +GOTEST=$(GOCMD) test + RELDIR = crowdsec-$(BUILD_VERSION) .PHONY: all @@ -89,7 +92,7 @@ goversion: fi .PHONY: clean -clean: +clean: testclean @$(MAKE) -C $(CROWDSEC_FOLDER) clean --no-print-directory @$(MAKE) -C $(CSCLI_FOLDER) clean --no-print-directory @$(RM) $(CROWDSEC_BIN) @@ -101,6 +104,7 @@ clean: @$(RM) $(SPLUNK_PLUGIN_FOLDER)/$(SPLUNK_PLUGIN_BIN) @$(RM) $(EMAIL_PLUGIN_FOLDER)/$(EMAIL_PLUGIN_BIN) + cscli: goversion @GOARCH=$(GOARCH) GOOS=$(GOOS) $(MAKE) -C $(CSCLI_FOLDER) build --no-print-directory @@ -137,8 +141,14 @@ splunk-plugin_static:goversion email-plugin_static:goversion @GOARCH=$(GOARCH) GOOS=$(GOOS) $(MAKE) -C $(EMAIL_PLUGIN_FOLDER) static --no-print-directory +.PHONY: testclean +testclean: + @$(RM) pkg/apiserver/ent + @$(RM) -r pkg/cwhub/hubdir + +.PHONY: test test: goversion - @$(MAKE) -C $(CROWDSEC_FOLDER) test --no-print-directory + $(GOTEST) $(LD_OPTS) ./... .PHONY: package package: diff --git a/cmd/crowdsec/Makefile b/cmd/crowdsec/Makefile index 07bb2bc9c..eff0e6eb5 100644 --- a/cmd/crowdsec/Makefile +++ b/cmd/crowdsec/Makefile @@ -27,7 +27,7 @@ test: $(GOTEST) $(LD_OPTS) -v ./... clean: - rm -f $(CROWDSEC_BIN) + @$(RM) $(CROWDSEC_BIN) .PHONY: install install: install-conf install-bin