Fix documentation and test invocation

This commit is contained in:
Denis Merigoux 2022-08-30 13:48:20 +02:00
parent 60b98783f0
commit 5bddde1c68
No known key found for this signature in database
GPG Key ID: EE99DCFA365C3EE3
4 changed files with 27 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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_<en/fr>/`: 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:

View File

@ -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