You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The possibility to write tests cases corresponding to specific catala's compiler arguments. For instance --optimize or --avoid_exceptions modify the compilation results, hence failing the test. Adding other outputs formats (for instance .catala_en.avoid_exception.ml) could solve the problem, but other solution might be better.
To check if a compilation pass is correct, one way is to check whenever it type-check correctly inside ocaml. To do so, we need at least to import catala.runtime. One solution could be to generate dune files.
The text was updated successfully, but these errors were encountered:
I think it will preferable to implement this in a separate PR, indeed, I will run out of time. Consequently, I prefer to finish #186 by providing the minimal features first.
denismerigoux
changed the title
Improving clerk
Specifying catala options in Clerk and backend testing
Jul 8, 2022
For the specification of Catala options in Clerk, here is the solution we've chosen. Suppose you have a file A.catala_en that you want to test using several unit tests that act on one or more scope of A.catala_en, with different combinations of catala compiler options to use.
Inside A.catala_en, you can specify all those unit tests using a little test specification DSL that will be interpreted by Clerk:
```catala-test { id="with_optim" }
catala Interpret -s A --optimize```
Using that declaration, Clerk called a first time with -r will create an expected output file whose name is the heading name (with a suffix if there are several tests inside one heading). Then it will run Catala with the specified options and fill the output file with the output of the command (stdout and stderr mixed).
Next time, calling Clerk without -r will parse again the test declaration in the file to test to recreate the Catala command to run, then it will run the Catala command and diff its output against the expected output file created earlier.
Some features are missing inside clerk
--optimize
or--avoid_exceptions
modify the compilation results, hence failing the test. Adding other outputs formats (for instance .catala_en.avoid_exception.ml) could solve the problem, but other solution might be better.The text was updated successfully, but these errors were encountered: