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
#186 introduced some test for Clerk, however, there are very minimal and not enough at all.
It only allowed to setup alcotest and write some test case examples.
The goal is to have enough pertinent test cases to be confident of the validity of the Clerk behavior.
Solutions
There is two main solutions.
The first one is to continue with alcotest and just add test cases in test_clerk_driver.ml, therefore, this method will allow to have a different granularity for tests.
A second solution consists to extend Clerk by adding two new ninja rules: test_clerk and reset_clerk. This will allow to compare pre-generated correctbuild.ninja files with the one produced by the current build of Clerk. The main advantage of this method is to speed up the test case writing phase, indeed, writing test cases in OCaml could be very tedious: either Ninja_utils.ninja structure must be initialized by hand or the expected result of the Ninja_utils.format function is hard-coded in a string.
At the end, the two solutions could coexist, but to ensure the validity of the generated build.ninja files the second one should be easier to implement.
The text was updated successfully, but these errors were encountered:
#186 introduced some test for Clerk, however, there are very minimal and not enough at all.
It only allowed to setup
alcotest
and write some test case examples.The goal is to have enough pertinent test cases to be confident of the validity of the Clerk behavior.
Solutions
There is two main solutions.
The first one is to continue with
alcotest
and just add test cases intest_clerk_driver.ml
, therefore, this method will allow to have a different granularity for tests.A second solution consists to extend Clerk by adding two new ninja rules:
test_clerk
andreset_clerk
. This will allow to compare pre-generated correctbuild.ninja
files with the one produced by the current build of Clerk. The main advantage of this method is to speed up the test case writing phase, indeed, writing test cases in OCaml could be very tedious: eitherNinja_utils.ninja
structure must be initialized by hand or the expected result of theNinja_utils.format
function is hard-coded in a string.At the end, the two solutions could coexist, but to ensure the validity of the generated
build.ninja
files the second one should be easier to implement.The text was updated successfully, but these errors were encountered: