-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (44 loc) · 1.56 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
PROPER=../proper
DIALYZER_PLT=playground.plt
DIALYZER_RESULT=playground.dialyzed
ERL=erl
ERLFLAGS=-pa ${PROPER}/ebin
ERLC=erlc
ERLCFLAGS=+debug_info -I ${PROPER}/include -pa ${PROPER}/ebin
.SUFFIXES: .erl .beam
.erl.beam:
${ERLC} ${ERLCFLAGS} $<
MODULES=ttq.erl ttq_eqc.erl
all: test_report.txt ${DIALYZER_RESULT}
test_report.txt: ${MODULES:.erl=.beam}
@echo Running PropEr
@${ERL} ${ERLFLAGS} -noshell -eval ' \
{ok, F} = file:open("$@", [write]), \
Failed_Spec_Cases = proper:check_specs(ttq, [{to_file, F}, long_result]), \
Failed_Property_Cases = proper:module(ttq_eqc, [{to_file, F}, long_result]), \
ok = file:close(F), \
Status = case {Failed_Spec_Cases, Failed_Property_Cases} of \
{[], []} -> \
0; \
{Failed_Spec_Cases, []} -> \
io:format("Failed proper:check_specs: ~p~n", [Failed_Spec_Cases]), \
1; \
{[], Failed_Property_Cases} -> \
io:format("Failed proper:module: ~p~n", [Failed_Property_Cases]), \
1; \
{Failed_Spec_Cases, Failed_Property_Cases} -> \
io:format("Failed proper:check_specs: ~p~n", [Failed_Spec_Cases]), \
io:format("Failed proper:module: ~p~n", [Failed_Property_Cases]), \
1 \
end, \
halt(Status). \
'
${DIALYZER_RESULT}: ${DIALYZER_PLT} ${MODULES:.erl=.beam}
dialyzer --no_check_plt --plt ${DIALYZER_PLT} --output $@ --apps .
${MODULES:.erl=.beam}: ttq.hrl
${DIALYZER_PLT}:
dialyzer --build_plt --output_plt $@ --apps erts kernel stdlib compiler crypto ${PROPER}/ebin
clean:
rm -f ${MODULES:.erl=.beam} test_report.txt ${DIALYZER_RESULT} erl_crash.dump
nuke: clean
rm -f ${DIALYZER_PLT}