-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
116 lines (87 loc) · 3.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
BUILD_DIR := $(CURDIR)/_build
REBAR := rebar3
CT_READABLE ?= false
compile:
$(REBAR) do compile, dialyzer, xref
.PHONY: all
all: compile test
.PHONY: clean
clean: distclean
.PHONY: distclean
distclean:
@rm -rf _build erl_crash.dump rebar3.crashdump rebar.lock
.PHONY: xref
xref:
$(REBAR) xref
.PHONY: eunit
eunit: compile
$(REBAR) eunit verbose=true
.PHONY: test
test: smoke-test ct-consistency ct-fault-tolerance cover
.PHONY: smoke-test
smoke-test:
$(REBAR) do eunit, ct -v --cover --readable=$(CT_READABLE)
$(REBAR) ct --readable=$(CT_READABLE) -v --suite mria_compatibility_suite
.PHONY: ct-consistency
ct-consistency:
$(REBAR) ct --cover -v --readable=$(CT_READABLE) --suite mria_proper_suite,mria_proper_mixed_cluster_suite
.PHONY: ct-fault-tolerance
ct-fault-tolerance:
$(REBAR) ct --cover -v --readable=$(CT_READABLE) --suite mria_fault_tolerance_suite
.PHONY: ct-suite
ct-suite: compile
ifneq ($(TESTCASE),)
$(REBAR) ct -v --readable=$(CT_READABLE) --suite $(SUITE) --case $(TESTCASE)
else
$(REBAR) ct -v --readable=$(CT_READABLE) --suite $(SUITE)
endif
cover: | smoke-test ct-consistency ct-fault-tolerance
$(REBAR) cover
.PHONY: coveralls
coveralls:
@rebar3 as test coveralls send
.PHONY: dialyzer
dialyzer:
$(REBAR) dialyzer
CUTTLEFISH_SCRIPT = _build/default/lib/cuttlefish/cuttlefish
$(CUTTLEFISH_SCRIPT):
@${REBAR} get-deps
@if [ ! -f cuttlefish ]; then make -C _build/default/lib/cuttlefish; fi
app.config: $(CUTTLEFISH_SCRIPT)
$(verbose) $(CUTTLEFISH_SCRIPT) -l info -e etc/ -c etc/mria.conf.example -i priv/mria.schema -d data/
##########################################################################################
# Concuerror
##########################################################################################
CONCUERROR := $(BUILD_DIR)/Concuerror/bin/concuerror
CONCUERROR_RUN := $(CONCUERROR) \
--treat_as_normal shutdown --treat_as_normal normal --treat_as_normal intentional \
--treat_as_normal optvar_set --treat_as_normal optvar_stopped --treat_as_normal optvar_retry \
-x code -x code_server -x error_handler \
-pa $(BUILD_DIR)/concuerror+test/lib/snabbkaffe/ebin \
-pa $(BUILD_DIR)/concuerror+test/lib/optvar/ebin \
-pa $(BUILD_DIR)/concuerror+test/lib/mria/ebin
concuerror = $(CONCUERROR_RUN) -f $(BUILD_DIR)/concuerror+test/lib/mria/test/concuerror_tests.beam -t $(1) || \
{ cat concuerror_report.txt; exit 1; }
.PHONY: concuerror_test
concuerror_test: $(CONCUERROR)
rebar3 as concuerror eunit -m concuerror_tests
# $(call concuerror,wait_for_shards_crash_test)
$(call concuerror,notify_different_tags_test)
$(call concuerror,get_core_node_test)
$(call concuerror,dirty_bootstrap_test)
$(call concuerror,wait_for_shards_timeout_test)
$(CONCUERROR):
mkdir -p _build/
cd _build && git clone https://github.com/parapluu/Concuerror.git
$(MAKE) -C _build/Concuerror/
##########################################################################################
# Docs
##########################################################################################
DOC_DIR=doc
DOC_SRC_DIR=$(DOC_DIR)/src
UMLS=$(wildcard $(DOC_SRC_DIR)/*.uml)
PICS=$(UMLS:$(DOC_SRC_DIR)/%.uml=$(DOC_DIR)/%.png)
.PHONY: doc
doc: $(PICS)
$(DOC_DIR)/%.png: $(DOC_SRC_DIR)/%.uml
cat $< | plantuml -pipe > $@