summaryrefslogtreecommitdiff
path: root/Makefile
blob: a9b24400b98d1fe7202f47ce1adcc07e766d3170 (plain)
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
all: build-run-check-trace

CHARON_HOME=../charon/charon
CHARON_TESTS_DIR=$(CHARON_HOME)/tests
RS_TEST_FILE=tests/no_nested_borrows.rs
CFIM_TEST_FILE=$(CHARON_TESTS_DIR)/no_nested_borrows.cfim

# Build the project and run the executable
.PHONY: build-run
build-run:
	dune build src/main.exe && dune exec src/main.exe

# Build the project and run the executable, then check that the behaviour
# of the interpreter didn't change by comparing the newly generated trace
# with a reference.
.PHONY: build-run-check-trace
build-run-check-trace: generate-cfim
	dune build src/main.exe && \
	dune exec src/main.exe $(CFIM_TEST_FILE) > tests/trace_current.txt && \
	cmp tests/trace_reference.txt tests/trace_current.txt && \
	rm tests/trace_current.txt

# Build the project and update the trace
.PHONY: regen-trace
regen-trace: generate-cfim
	dune build src/main.exe && \
	dune exec src/main.exe $(CFIM_TEST_FILE) > tests/trace_current.txt && \
        rm tests/trace_reference.txt && \
	mv tests/trace_current.txt tests/trace_reference.txt

.PHONY: generate-cfim
generate-cfim:
	cd ../charon/charon && cargo run $(RS_TEST_FILE)

doc:
	dune build @doc