catala/build_system
2022-02-11 16:24:32 +01:00
..
test test(clerk): add minimal unit testing structure 2022-02-08 12:45:52 +01:00
clerk.ml fix(clerk): add the Catala command to the build output name 2022-02-11 16:24:32 +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 docs(clerk): add comments to ninja_utils.ml 2022-02-10 12:24:35 +01:00
ninja_utils.mli docs(clerk): add comments to ninja_utils.ml 2022-02-10 12:24:35 +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

...