-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.run
72 lines (53 loc) · 1.84 KB
/
Makefile.run
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
#
# This Makefile runs certain test plans
#
# This attempt to run executable `feditest` in your $PATH. If you'd like
# to run a different executable, such as one in a virtual environment,
# invoke this Makefile with extra parameter FEDITEST=path/to/my/feditest
#
FEDITEST?=feditest
Q?=
# Could set from the command-line to something like: 'Q=.$(shell git branch --show-current)'
EX?=examples$(Q)
SANDBOX_TESTPLANS= \
sandbox-all-clientA-vs-server1 \
sandbox-all-clientA-vs-server2faulty \
sandbox-all-clientA-vs-both-server1-server2faulty
default : clean sandbox
all : \
sandbox
sandbox : \
sandbox-transcripts \
sandbox-transcripts-tap \
sandbox-transcripts-html
sandbox-transcripts : \
$(patsubst %, $(EX)/testresults/%.json, $(SANDBOX_TESTPLANS))
sandbox-transcripts-tap : \
$(patsubst %, $(EX)/testresults/%.tap, $(SANDBOX_TESTPLANS))
sandbox-transcripts-html : \
$(patsubst %, $(EX)/testresults/%.html, $(SANDBOX_TESTPLANS))
########## General rules to make things simpler ##########
# Given a testplan in $(EX)/testplans, run it and generate a testrun JSON transcript in $(EX)/testresults with the same name
$(EX)/testresults/%.json : $(EX)/testplans/%.json dirs
$(FEDITEST) run \
--testplan $< \
--json $@ \
|| echo 'ERRORS in the test run (as expected), so we continue'
# Given a testrun JSON transcript, convert it to TAP format
%.tap : %.json
$(FEDITEST) convert-transcript \
--in $< \
--tap $@
# Given a testrun JSON transcript, convert it to HTML format
%.html : %.json
$(FEDITEST) convert-transcript \
--in $< \
--html $@
########## and the rest ##########
dirs:
[[ -d $(EX)/testresults ]] || mkdir -p $(EX)/testresults
clean :
rm $(EX)/testresults/*.{json,tap,html,css} >/dev/null 2>&1 || true
.PHONY : \
default all dirs clean \
sandbox sandbox-transcript sandbox-transcripts-tap sandbox-transcripts-html