Clerk tests: use separate dirs for different flags, to preserve caching

The default output remains at the top of _build if no specific flags have been
given, the others are in `_build/test<flags>`
This commit is contained in:
Louis Gesbert 2024-02-26 11:45:17 +01:00
parent 1ea77201ff
commit b43cc04e16
2 changed files with 7 additions and 2 deletions

View File

@ -203,12 +203,12 @@ unit-tests: .FORCE
dune build @for-tests @runtest
#> test : Run interpreter tests
test: .FORCE
test: .FORCE compiler
$(CLERK_TEST)
tests: test
TEST_FLAGS_LIST = \
TEST_FLAGS_LIST = ""\
-O \
--lcalc \
--lcalc,--avoid-exceptions,-O

View File

@ -868,6 +868,11 @@ let build_statements include_dirs dir =
let gen_ninja_file catala_exe catala_flags build_dir include_dirs test_flags dir
=
let build_dir =
match test_flags with
| [] -> build_dir
| flags -> File.((build_dir / "test") ^ String.concat "" flags)
in
let ( @+ ) = Seq.append in
Seq.return
(Nj.Comment (Printf.sprintf "File generated by Clerk v.%s\n" version))