Commit Graph

4056 Commits

Author SHA1 Message Date
vbot
c26d3fdf4a
Refactor and improve suggestions' pretty-printing 2024-06-21 11:11:53 +02:00
vbot
441dd54ec3
Refactor suggestions 2024-06-20 15:59:54 +02:00
vbot
41caecef63
Add verbose error test 2024-06-20 15:59:54 +02:00
vbot
435794d70a
Add error messages numbering (#634) 2024-06-20 15:41:55 +02:00
Denis Merigoux
c438aa1a68
Fix spurious clerk rebuilds (#635) 2024-06-20 15:41:06 +02:00
Louis Gesbert
b83f613dce Fix spurious clerk rebuilds
Hm apparently not everyone has an OCaml compiler that unconditionally generates
`cmt` files ;)
2024-06-20 14:41:57 +02:00
Louis Gesbert
ad15984d0b More space between multiple errors, no numbers if just one 2024-06-20 11:15:53 +02:00
vbot
a7094fe52d
Add messages numbering 2024-06-19 18:06:03 +02:00
Louis Gesbert
8c0d5f006f
Generate tests reports from 'clerk test' (#632) 2024-06-19 16:50:01 +02:00
Louis Gesbert
859a602c0b
Clerk reports: add verbosity flags
`--summary`
`--short`
`--failures` (default)
`--verbose`

(`--debug` also adds some detail, e.g. the commands to reproduce non-failing
tests, or the files without failures in the default mode)
2024-06-19 16:10:26 +02:00
Louis Gesbert
80400d838a
Messages: improve string padding processing 2024-06-19 16:10:26 +02:00
Louis Gesbert
45b0feaf20
Generate tests reports from 'clerk test'
This is a proper replacement for the previous shell-based placeholder hack.

Here is a summary:

- `clerk runtest` (normally run by ninja) is much extended:
  * besides generating the test@out file, it checks individual tests for success
    and can write a report file containing their status, and the positions for
    their (expected/current) outputs (this uses `Marshal`)
  * it now handles out-tests directly in addition to inline-tests, for which
    it generates the separate output file ; they are included in the report

- ninja is now tasked with building all the test reports (which shouldn't fail);
  for directories, individual reports are concatenated (as before).
  Removing intermediate report rules, and out-test rules means that the ninja
  file is much simplified.

- then, clerk takes back control, reads the final reports and formats them in a
  user-friendly way. Printing the reports may imply running `diff` internally.
  In particular, the commands to easily reproduce each test are provided.
  Resetting the test results if required is also done directly by clerk, at this
  stage.

A few switches are available to customise the output, but I am waiting for some
feedback before deciding what to make available from the CLI.

The `clerk report` command is available to manually explore test reports, but
normally the processing is done directly at the end of `clerk test` (i.e. ninja
will no longer call that command)
2024-06-19 16:10:26 +02:00
Louis Gesbert
b4a14bb102
Small code cleanups 2024-06-19 16:10:15 +02:00
vbot
0e88a375a2
Multiple typing errors reporting (#631) 2024-06-19 15:43:28 +02:00
vbot
9622ac4172
Add an option to stop on the first delayed error encountered 2024-06-19 14:52:32 +02:00
vbot
a2c023c24c
Add multiple typing error test 2024-06-19 14:52:32 +02:00
vbot
6d3239376f
Adapt existing tests output 2024-06-19 14:52:31 +02:00
vbot
e7beb0daad
Fix typing error message consistency 2024-06-19 14:52:31 +02:00
vbot
b2449f7b4c
Add multiple typing errors using delayed errors 2024-06-19 14:52:31 +02:00
Denis Merigoux
e96a72f6e3
Add PR policies in CONTRIBUTING.md (#633) 2024-06-19 14:15:43 +02:00
vbot
b7b978247d
Add PR policies in contributing 2024-06-19 12:02:51 +02:00
Louis Gesbert
1fe15eb22b
Multiple parsing errors reporting (#630) 2024-06-18 18:18:17 +02:00
vbot
62470d0db8
Replace failwith by internal errors 2024-06-18 16:28:20 +02:00
vbot
37945f189b
Add simple parsing tests 2024-06-17 15:39:56 +02:00
vbot
0b6eebd96b
Adapt existing test results 2024-06-17 15:38:41 +02:00
vbot
4a44698fe7
Add multiple parsing error support 2024-06-17 15:38:33 +02:00
vbot
421d281fc1
Add delayed errors in Message 2024-06-17 15:36:38 +02:00
Denis Merigoux
01b03b69a0
Fix error message typo (#629) 2024-06-05 16:07:17 +02:00
vbot
8c95971f1e
Fix error message typo 2024-06-05 15:19:12 +02:00
Denis Merigoux
a0c982a6c3
Typing across closure conversion (#627) 2024-06-03 09:39:17 +02:00
Denis Merigoux
5da46ff7be
Remove extra space 2024-06-03 09:06:57 +02:00
Louis Gesbert
4436d50011 C backend: To/FromClosureEnv are no-ops
Let them pass through.
2024-05-31 16:23:26 +02:00
Louis Gesbert
79e0dcecda Forbid reformatting in tests/
this seems to be confusing the CI with expected test outputs reformatted by
dune/ocamlformat.
2024-05-30 17:09:13 +02:00
Louis Gesbert
035dff35a3 Preserve and propagate types through closure conversion
some of the types (in particular, in hoisted closures) could not be
reconstructed afterwards. This properly propagates the types, including to
closure deconstruction time, giving additional insurance; and allowing
monomorphisation not to choke on the result.
2024-05-30 17:00:07 +02:00
Louis Gesbert
4acf321309 C backend: make error raising more concise 2024-05-30 16:59:55 +02:00
Louis Gesbert
eea30381a2 C backend: use switches for matches 2024-05-30 16:19:55 +02:00
Louis Gesbert
081605d04d tests: check the generated C code
(and update for new errors)
2024-05-30 16:19:55 +02:00
Louis Gesbert
9af7548bf0
Implement module hashes and checks (#625) 2024-05-28 12:36:40 +02:00
Louis Gesbert
db87409125 Replace module hashes for external modules
NOTE: This is a temporary solution

A future approach could be to have Catala generate a module loader (with the
proper hash), relieving the user implementation from having to do the
registration.
2024-05-28 11:43:50 +02:00
Louis Gesbert
f04e889173 Pass the "external module" info along passes 2024-05-28 11:43:50 +02:00
Louis Gesbert
709b51beb6 Fix hashing of submodule references 2024-05-28 11:43:50 +02:00
Louis Gesbert
072d428fc3 Ensure each module interface is computed only once
(they can appear multiple times in the tree of dependencies)
2024-05-28 11:43:50 +02:00
Louis Gesbert
c9be9bc3ad Update test ouputs 2024-05-28 11:43:50 +02:00
Louis Gesbert
d0998312eb Inline tests: add lightweight sanitisation of the command outputs 2024-05-28 11:43:50 +02:00
Louis Gesbert
a94c5fe644 Clerk runtest: bufferise command output
instead of directing the output directly to the file.
2024-05-28 11:43:50 +02:00
Louis Gesbert
403156b36e Computation and checking of module hashes
This includes a few separate changes:

- pass visibility information of declarations (depending on wether the
  declaration was in a ```catala-metadata block or not)

- add reasonable hash computation functions to discriminate the interfaces. In
  particular:
  * Uids have a `hash` function that depends on their string, but not on their
    actual uid (which is not stable between runs of the compiler) ; the existing
    `hash` function and its uses have been renamed to `id`.
  * The `Hash` module provides the tools to properly combine hashes, etc. While
    we rely on `Hashtbl.hash` for the atoms, we take care not to use it on any
    recursive structure (it relies on a bounded traversal).

- insert the hashes in the artefacts, and properly check and report those (for
  OCaml)

**Remains to do**:

- Record and check the hashes in the other backends

- Provide a way to get stable inline-test outputs in the presence of module
  hashes

- Provide a way to write external modules that don't break at every Catala
  update.
2024-05-28 11:43:50 +02:00
Louis Gesbert
372058bc42
Combine English and French VS Code extensions (#622) 2024-05-22 16:12:38 +02:00
Denis Merigoux
e7853d69cf
Fixes in Python runtime (#618) 2024-05-21 12:05:17 +02:00
Louis Gesbert
6322e5c001 VScode: add LICENSE.txt before publication 2024-05-21 11:43:00 +02:00
Louis Gesbert
830f9fc84a vscode extension: add registered publisher name 2024-05-21 11:23:25 +02:00