summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile22
1 files changed, 17 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 25a8b06f..ef8514ac 100644
--- a/Makefile
+++ b/Makefile
@@ -2,10 +2,13 @@ all: build-test
CHARON_HOME = ../charon
CHARON_EXEC = $(CHARON_HOME)/charon
-CHARON_TESTS_DIR = $(CHARON_HOME)/tests/cfim
-CHARON_OPTIONS = --dest ../tests/cfim --no-code-duplication
DEST_DIR = tests
+# We use those variables, whose definition depends on the rule we apply
+CHARON_TESTS_DIR =
+CHARON_OPTIONS =
+CHARON_TESTS_SRC =
+
# The user can specify additional translation options for Aeneas:
OPTIONS ?=
@@ -26,7 +29,8 @@ build:
# Test the project
.PHONY: test
-test: build translate-no_nested_borrows translate-hashmap translate-paper
+test: build translate-no_nested_borrows translate-hashmap translate-paper \
+ translate-nll-betree_nll
# Add specific options to some tests
translate-no_nested_borrows translate-paper: \
@@ -35,13 +39,21 @@ translate-no_nested_borrows translate-paper: SUBDIR:=misc
translate-hashmap: TRANS_OPTIONS:=$(TRANS_OPTIONS) -template-clauses -no-state
translate-hashmap: SUBDIR:=hashmap
-# Generic rule to extract the CFIM from a rust file
+translate-nll-betree_nll: TRANS_OPTIONS=-test-units -no-split-files -no-state -no-decreases-clauses
+translate-nll-betree_nll: SUBDIR:=misc
+
+# Generic rules to extract the CFIM from a rust file
+# The "standard" and the nll (non-linear lifetime) tests are in separate
+# directories in Charon
.PHONY: gen-cfim-%
+gen-cfim-%: CHARON_OPTIONS = --dest ../tests/cfim --no-code-duplication
+gen-cfim-%: CHARON_TESTS_SRC = ../tests/src
gen-cfim-%: build
- cd $(CHARON_HOME)/charon && cargo run ../tests/src/$*.rs $(CHARON_OPTIONS)
+ cd $(CHARON_HOME)/charon && cargo run $(CHARON_TESTS_SRC)/$*.rs $(CHARON_OPTIONS)
# Generic rule to test the translation on a CFIM file
.PHONY: translate-%
+translate-%: CHARON_TESTS_DIR = $(CHARON_HOME)/tests/cfim
translate-%: gen-cfim-%
dune exec -- src/main.exe $(CHARON_TESTS_DIR)/$*.cfim -dest $(DEST_DIR)/$(SUBDIR) $(TRANS_OPTIONS)