|
@@ -27,11 +27,25 @@ PID_DIR = $(LOCAL_DIR)/var/run
|
|
PLUGIN_DIR = $(LOCAL_DIR)/lib/crowdsec/plugins
|
|
PLUGIN_DIR = $(LOCAL_DIR)/lib/crowdsec/plugins
|
|
DB_BACKEND ?= sqlite
|
|
DB_BACKEND ?= sqlite
|
|
|
|
|
|
|
|
+ifdef TEST_COVERAGE
|
|
|
|
+ CROWDSEC = "$(TEST_DIR)/crowdsec-wrapper"
|
|
|
|
+ CSCLI = "$(TEST_DIR)/cscli-wrapper"
|
|
|
|
+else
|
|
|
|
+ # the wrappers should work here too - it detects TEST_COVERAGE - but we allow
|
|
|
|
+ # overriding the path to the binaries
|
|
|
|
+ CROWDSEC ?= "$(BIN_DIR)/crowdsec"
|
|
|
|
+ CSCLI ?= "$(BIN_DIR)/cscli"
|
|
|
|
+endif
|
|
|
|
+
|
|
|
|
+# If you change the name of the crowdsec executable, make sure the pgrep
|
|
|
|
+# parameters are correct in $(TEST_DIR)/assert-crowdsec-not-running
|
|
|
|
+
|
|
define ENV :=
|
|
define ENV :=
|
|
export TEST_DIR="$(TEST_DIR)"
|
|
export TEST_DIR="$(TEST_DIR)"
|
|
export LOCAL_DIR="$(LOCAL_DIR)"
|
|
export LOCAL_DIR="$(LOCAL_DIR)"
|
|
-export CROWDSEC="$(BIN_DIR)/crowdsec"
|
|
|
|
-export CSCLI="$(BIN_DIR)/cscli"
|
|
|
|
|
|
+export BIN_DIR="$(BIN_DIR)"
|
|
|
|
+export CROWDSEC="$(CROWDSEC)"
|
|
|
|
+export CSCLI="$(CSCLI)"
|
|
export CONFIG_YAML="$(CONFIG_DIR)/config.yaml"
|
|
export CONFIG_YAML="$(CONFIG_DIR)/config.yaml"
|
|
export LOCAL_INIT_DIR="$(LOCAL_INIT_DIR)"
|
|
export LOCAL_INIT_DIR="$(LOCAL_INIT_DIR)"
|
|
export LOG_DIR="$(LOG_DIR)"
|
|
export LOG_DIR="$(LOG_DIR)"
|
|
@@ -41,6 +55,7 @@ export DB_BACKEND="$(DB_BACKEND)"
|
|
export INIT_BACKEND="$(INIT_BACKEND)"
|
|
export INIT_BACKEND="$(INIT_BACKEND)"
|
|
export CONFIG_BACKEND="$(CONFIG_BACKEND)"
|
|
export CONFIG_BACKEND="$(CONFIG_BACKEND)"
|
|
export PACKAGE_TESTING="$(PACKAGE_TESTING)"
|
|
export PACKAGE_TESTING="$(PACKAGE_TESTING)"
|
|
|
|
+export TEST_COVERAGE="$(TEST_COVERAGE)"
|
|
endef
|
|
endef
|
|
|
|
|
|
bats-all: bats-clean bats-build bats-fixture bats-test bats-test-hub
|
|
bats-all: bats-clean bats-build bats-fixture bats-test bats-test-hub
|