build(test): add proper checking targets for each application
This commit is contained in:
parent
bd8cde3479
commit
4f6216b812
10
Makefile
10
Makefile
|
@ -40,7 +40,7 @@ eunit: $(REBAR)
|
||||||
|
|
||||||
.PHONY: proper
|
.PHONY: proper
|
||||||
proper: $(REBAR)
|
proper: $(REBAR)
|
||||||
@ENABLE_COVER_COMPILE=1 $(REBAR) as test proper -d test/props -c
|
@ENABLE_COVER_COMPILE=1 $(REBAR) proper -d test/props -c
|
||||||
|
|
||||||
.PHONY: ct
|
.PHONY: ct
|
||||||
ct: $(REBAR)
|
ct: $(REBAR)
|
||||||
|
@ -56,6 +56,14 @@ $1-ct:
|
||||||
endef
|
endef
|
||||||
$(foreach app,$(APPS),$(eval $(call gen-app-ct-target,$(app))))
|
$(foreach app,$(APPS),$(eval $(call gen-app-ct-target,$(app))))
|
||||||
|
|
||||||
|
## apps/name-prop targets
|
||||||
|
.PHONY: $(APPS:%=%-prop)
|
||||||
|
define gen-app-prop-target
|
||||||
|
$1-prop:
|
||||||
|
$(REBAR) proper -d test/props -v -m $(shell $(CURDIR)/scripts/find-props.sh $1)
|
||||||
|
endef
|
||||||
|
$(foreach app,$(APPS),$(eval $(call gen-app-prop-target,$(app))))
|
||||||
|
|
||||||
.PHONY: cover
|
.PHONY: cover
|
||||||
cover: $(REBAR)
|
cover: $(REBAR)
|
||||||
@ENABLE_COVER_COMPILE=1 $(REBAR) cover
|
@ENABLE_COVER_COMPILE=1 $(REBAR) cover
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
## this script prints out all test/props/prop_*.erl files of a given app,
|
||||||
|
## file names are separated by comma for proper's `-m` option
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# ensure dir
|
||||||
|
cd -P -- "$(dirname -- "$0")/.."
|
||||||
|
|
||||||
|
BASEDIR="."
|
||||||
|
if [ "$1" != "emqx" ]; then
|
||||||
|
BASEDIR="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
find "${BASEDIR}/test/props" -name "prop_*.erl" 2>/dev/null | xargs -I{} basename {} .erl | xargs | tr ' ' ','
|
|
@ -12,4 +12,4 @@ TESTDIR="test"
|
||||||
if [ "$1" != "emqx" ]; then
|
if [ "$1" != "emqx" ]; then
|
||||||
TESTDIR="$1/test"
|
TESTDIR="$1/test"
|
||||||
fi
|
fi
|
||||||
find "${TESTDIR}" -name "*_SUITE.erl" | tr -d '\r' | tr '\n' ','
|
find "${TESTDIR}" -name "*_SUITE.erl" 2>/dev/null | xargs | tr ' ' ','
|
||||||
|
|
Loading…
Reference in New Issue