forked from miking-lang/miking-dppl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-coreppl.mk
53 lines (37 loc) · 1.36 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
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))
test-infer-files=$(shell find coreppl/test/coreppl-to-mexpr/infer -name "*.mc")
test-cli-files=\
$(shell find coreppl/test/coreppl-to-mexpr/cli \
coreppl/test/coreppl-to-rootppl/cli -name "*.mc")
.PHONY: all
all: cppl compiler
############################################
## Tests in CorePPL compiler source files ##
############################################
.PHONY: compiler
compiler: ${test-files}
${test-files}::
@./make test $@
###################
## CorePPL tests ##
###################
.PHONY: cppl
cppl: ${test-infer-files} ${test-cli-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 $@