forked from miking-lang/miking-dppl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-coreppl.mk
80 lines (58 loc) · 2.31 KB
/
test-coreppl.mk
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
include vars.mk
# Include all .mc files but ignore files under coreppl-to-mexpr that starts
# with "runtime" (they cannot be executed standalone)
test-files=$(shell find coreppl/src -name "*.mc" -not \( -path "*coreppl-to-mexpr/*" \( -name "runtime*.mc" -or -name "top.mc" \) \))
test-files+=coreppl/src/coreppl-to-mexpr/runtimes.mc
# NOTE(dlunde,2021-10-27): Cannot yet be compiled
test-files := $(filter-out coreppl/src/pgm.mc,$(test-files))
test-files := $(filter-out coreppl/src/transformation.mc,$(test-files))
# NOTE(oerikss, 2024-04-08): Filter out the main file as it it print to standard
# out and it is compiled anyways when doing the inference tests.
test-files := $(filter-out coreppl/src/cppl.mc,$(test-files))
test-infer-files=$(shell find coreppl/test/coreppl-to-mexpr/infer -name "*.mc")
test-coin-iter-alter=$(shell find coreppl/test/coreppl-to-mexpr/cli -name "coin-iter-alter.mc")
test-gamma-poisson=$(shell find coreppl/test/coreppl-to-mexpr/cli -name "gamma-poisson.mc")
test-crbd=$(shell find coreppl/test/coreppl-to-mexpr/infer -name "crbd.mc")
test-staticdelay-files=$(shell find coreppl/test/coreppl-to-mexpr/static-delay -name "*.mc")
test-cli-files=\
$(shell find coreppl/test/coreppl-to-mexpr/cli \
coreppl/test/coreppl-to-rootppl/cli -name "*.mc")
.PHONY: all
all: compiler cppl
############################################
## Tests in CorePPL compiler source files ##
############################################
.PHONY: compiler
compiler: ${test-files}
${test-files}::
@./make test $@
###################
## CorePPL tests ##
###################
.PHONY: cppl
cppl: ${test-staticdelay-files} ${test-infer-files} ${test-cli-files}
.PHONY: static-delay
static-delay: ${test-staticdelay-files}
.PHONY: coin-iter-alter
coin-iter-alter: ${test-coin-iter-alter}
.PHONY: gamma-poisson
gamma-poisson: ${test-gamma-poisson}
.PHONY: crbd
crbd: ${test-crbd}
.PHONY: infer-files
infer-files: ${test-infer-files}
export CPPL_NAME
export MIDPPL_PATH=${CURDIR}
export MIDPPL_SRC=${MIDPPL_PATH}/${CPPL_SRC}
export ROOTPPL_BIN
export RPPL_ENGINE_SRC=${MIDPPL_PATH}/${ROOTPPL_SRC}
# Infer tests
${test-infer-files}::
@./make test-cppl $@ "build/${CPPL_NAME}"
# CLI tests
${test-cli-files}::
@./make test $@
# Static delay tests
${test-staticdelay-files}::
@./make test $@
# Infer unit tests coin-iter-alter