From 5bddde1c68fc044987586978f23f61b6860d3733 Mon Sep 17 00:00:00 2001 From: Denis Merigoux Date: Tue, 30 Aug 2022 13:48:20 +0200 Subject: [PATCH] Fix documentation and test invocation --- Makefile | 4 ++-- examples/Makefile | 16 +++++++++------- examples/README.md | 13 +++++++++---- tests/Makefile | 7 +++++++ 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index f5cdd423..285cc42d 100644 --- a/Makefile +++ b/Makefile @@ -303,10 +303,10 @@ CLERK=$(CLERK_BIN) --exe $(CATALA_BIN) \ .FORCE: test_suite: .FORCE - OCAMLRUNPARAM= $(CLERK) test tests + $(MAKE) -C tests pass_all_tests test_examples: .FORCE - OCAMLRUNPARAM= $(CLERK) test examples + $(MAKE) -C examples pass_all_tests #> tests : Run interpreter tests tests: test_suite test_examples diff --git a/examples/Makefile b/examples/Makefile index c5e7189b..efcd1ed8 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -8,16 +8,18 @@ CLERK=_build/default/build_system/clerk.exe --exe "_build/default/compiler/catal # Running legislation unit tests ################################ +pass_all_tests: + @cd ..;OCAMLRUNPARAM= $(CLERK) examples + +reset_all_tests: CLERK_OPTS+=--reset +reset_all_tests: + @cd ..;OCAMLRUNPARAM= $(CLERK) examples %.catala_en %.catala_fr %.catala_pl: .FORCE # Here we cd to the root of the Catala repository such that the paths \ # displayed in error messages start with `examples/` uniformly. - @cd ..;$(CLERK) examples/$@ - -TEST_FILES?=$(wildcard */*.catala*) - -pass_tests: $(TEST_FILES) -reset_tests: CLERK_OPTS+=--reset -reset_tests: $(TEST_FILES) + @cd ..;OCAMLRUNPARAM= $(CLERK) examples/$@ .FORCE: + +.PHONY: pass_all_tests reset_all_tests diff --git a/examples/README.md b/examples/README.md index 5f956717..e4599edc 100644 --- a/examples/README.md +++ b/examples/README.md @@ -10,11 +10,13 @@ of the Catala programming language development. ## List of examples - `allocations_familiales/`: computation of the French family benefits, based - on the _Code de la sécurité sociale_. This case study is the biggest and + on the _Code de la sécurité sociale_. +- `aides_logement`: computation of the French housing benefits, based on the + _Code de la construction et de l'habitation_. This case study is the biggest and most ambitious for Catala so far. - `code_general_impots/`: computation of the French income tax, based on the _Code général des impôts_. Currently, there are only stubs of program. -- `tutorial/`: Catala language tutorial for developers of tech-savvy lawyers. +- `tutorial_/`: Catala language tutorial for developers of tech-savvy lawyers. The tutorial is written like a piece of legislation that gets annotated by Catala snippets. - `us_tax_code/`: contains the Catala formalization of several sections of the @@ -74,9 +76,12 @@ compilation of the whole program using the standard expected by `clerk test`: enter `make help_clerk` from the root of the Catala repository to know more. Once your tests are written, then will automatically be added to the regression -suite executed using +suite executed using: - make -C examples tests + # From the root of the Catala repository + make test_examples + # From the examples/ folder + make pass_all_tests You can isolate a part of the regression suite by invoking: diff --git a/tests/Makefile b/tests/Makefile index 0436a0da..5d020235 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -15,3 +15,10 @@ CLERK=_build/default/build_system/clerk.exe --exe "_build/default/compiler/catal # Here we cd to the root of the Catala repository such that the paths \ # displayed in error messages start with `tests/` uniformly. @cd ..; $(CLERK) tests/$@ + +pass_all_tests: + @cd ..;OCAMLRUNPARAM= $(CLERK) tests + +reset_all_tests: CLERK_OPTS+=--reset +reset_all_tests: + @cd ..;OCAMLRUNPARAM= $(CLERK) tests