catala/build_system
Emile Rolley abeea09d7f feat(clerk): add support for multiple inputs
+ change the Makefile 'tests' rule to call only one time clerk
2022-02-22 18:06:12 +01:00
..
tests/test_array/good refactor(clerk): factorize functions for building ninja rules 2022-02-17 16:45:49 +01:00
clerk.ml feat(clerk): add support for multiple inputs 2022-02-22 18:06:12 +01:00
dune fix(clerk): unpath the build outputs to avoid writing corresponding files 2022-02-08 12:22:48 +01:00
ninja_utils.ml Display nice finish message when ending 2022-02-14 14:43:38 +01:00
ninja_utils.mli Display nice finish message when ending 2022-02-14 14:43:38 +01:00
README.md docs(clerk): add a readme for the build_system folder 2022-02-08 12:56:04 +01:00

Clerk

The build system for Catala.

Build

  • to build: dune build
  • to test: dune test
  • to run: dune exec ./clerk.exe

Usage

To test a specific file at path/to/file.catala_en

The command clerk test path/to/file.catala_en will run tests for each tested scope of path/to/file.catala_en.

Mechanics

build.ninja architecture:

rule test_scope
  command = catala -s $scope Interpret $tested_file --unstyle | colordiff -u -b $expected_output -
  description = Testing scope $scope of file $tested_file

build test: phony $
  test_<path-to-tested-dir1> $
  test_<path-to-tested-dir2>

build test_<path-to-tested-dir1>: phony $
  test_<path-to-tested-dir1-file1.catala_en> $
  test_<path-to-tested-dir1-file2.catala_en>

build test_<path-to-tested-dir1-file1.catala_en: phony $
  test_<scope1>_<path-to-tested-dir1-file1.catala_en.catala_en> $
  test_<scope2>_<path-to-tested-dir1-file1.catala_en.catala_en>

build test_<scope1>_<path-to-tested-dir1-file1.catala_en.catala_en>: test_scope
  scope = <scope1>
  tested_file = <path/to/tested/dir1/file1.catala_en>
  expected_output = <path/to/tested/dir1/output/file1.catala_en.<scope1>.Interpret

build test_<scope2>_<path-to-tested-dir1-file1.catala_en.catala_en: test_scope
  scope = <scope2>
  tested_file = <path/to/tested/dir1/file1.catala_en>
  expected_output = <path/to/tested/dir1/output/file1.catala_en.<scope2>.Interpret

...