-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
74 lines (60 loc) · 2.25 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
BUILD_DIR := $(CURDIR)/_build
CONCUERROR := $(BUILD_DIR)/Concuerror/bin/concuerror
CONCUERROR_RUN := $(CONCUERROR) \
--treat_as_normal shutdown --treat_as_normal normal \
-x code -x code_server -x error_handler \
-pa $(BUILD_DIR)/concuerror+test/lib/snabbkaffe/ebin
GEN_TESTS=$(patsubst doc/src/%.md, test/%_example.erl, $(wildcard doc/src/*.md))
.PHONY: all
all: $(GEN_TESTS)
rebar3 do dialyzer, eunit, ct --sname snk_main, xref
.PHONY: clean
clean:
rm -rf _build/
rm test/*_example.erl
test/%_example.erl: doc/src/%.md doc/src/extract_tests
./doc/src/extract_tests $< > $@
concuerror = \
@echo "\n=========================================\nRunning $(1)\n=========================================\n"; \
$(CONCUERROR_RUN) -f $(BUILD_DIR)/concuerror+test/lib/snabbkaffe/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,race_test)
$(call concuerror,block_until_multiple_events_test)
$(call concuerror,block_until_timeout_test)
$(call concuerror,causality_test)
$(call concuerror,fail_test)
$(call concuerror,force_order_test)
$(call concuerror,force_order_multiple_predicates_test)
$(call concuerror,force_order_parametrized_test)
$(call concuerror,force_order_multiple_events_test)
$(CONCUERROR):
mkdir -p _build/
cd _build && git clone https://github.com/parapluu/Concuerror.git
$(MAKE) -C _build/Concuerror/
##########################################################################################
## Documentation
##########################################################################################
DOCROOT := _build/snabbkaffe-docs
VSN := $(shell git describe --tags)
OUTDIR := "$(DOCROOT)/$(VSN)"
.PHONY: doc
doc:
rebar3 as dev ex_doc
.PHONY: doc-publish
doc-publish: $(DOCROOT)/index.html
$(DOCROOT)/index.html: doc $(OUTDIR) doc/src/make-homepage
cp -R doc/out/* $(OUTDIR)
doc/src/make-homepage $(VSN) > $@
cd $(DOCROOT) && \
git add --all && \
git commit -m "Add documentation for version $(VSN)" && \
git push --force
$(OUTDIR): $(DOCROOT)
@mkdir -p $(OUTDIR) # TODO clean the directory
$(DOCROOT):
@mkdir -p _build && \
cd _build && \
git clone git@github.com:kafka4beam/snabbkaffe-docs.git