-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathtest-coreppl.mk
85 lines (63 loc) · 2.65 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
81
82
83
84
85
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))
# NOTE(ThimotheeV, 2024-11-021): Filter out the inference test frame
# from the main test frame because they can be pretty long to complite
test-files := $(filter-out coreppl/test/coreppl-to-mexpr/cli/coin-iter-alter.mc,$(test-files))
test-inference=$(shell find coreppl/test/coreppl-to-mexpr/cli -name "coin-iter-alter.mc")
test-infer-files=$(shell find coreppl/test/coreppl-to-mexpr/infer -name "*.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 -name "*.mc")
# NOTE(johnwikman, 2024-09-13): The RootPPL compilation is currently broken, so
# leaving it commented out until someone has fixed RootPPL compilation.
#test-cli-files+=\
# $(shell find coreppl/test/coreppl-to-rootppl/cli -name "*.mc")
test-expectation-files=$(shell find coreppl/test/coreppl-to-mexpr/expectation -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} ${test-expectation-files}
.PHONY: infer
infer: ${test-infer-files}
.PHONY: static-delay
static-delay: ${test-staticdelay-files}
.PHONY: expectation
expectation: ${test-expectation-files}
.PHONY: inference
inference: ${test-inference}
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 $@
# Expectation tests
${test-expectation-files}::
@./make test-cppl $@ "build/${CPPL_NAME}"