Clerk_driver
module Nj = Ninja_utils
type expected_output_descr = {
}
readdir_sort dirname
returns the sorted subdirectories of dirname
in an array or an empty array if the dirname
doesn't exist.
type file_tests = {
tests : test list; | |
text_after : string; | (* Verbatim of everything following the last test *) |
}
val scan_for_inline_tests : string -> file_tests option
val search_for_expected_outputs : string -> expected_output_descr list
Given a file, looks in the relative output
directory if there are files with the same base name that contain expected outputs for different
module Var : sig ... end
Var references used in the Clerk file
val pipe_diff_cmd : Nj.Expr.t
val inline_test_rule : string -> string -> Nj.Rule.t
val inline_reset_rule : string -> string -> Nj.Rule.t
val add_reset_rules_aux :
redirect:string ->
rule_name:string ->
string ->
Ninja_utils.Rule.t Nj.RuleMap.t ->
Ninja_utils.Rule.t Nj.RuleMap.t
val add_test_rules_aux :
rule_name:string ->
string ->
Ninja_utils.Rule.t Nj.RuleMap.t ->
Ninja_utils.Rule.t Nj.RuleMap.t
val add_reset_rules :
string ->
Ninja_utils.Rule.t Nj.RuleMap.t ->
Ninja_utils.Rule.t Nj.RuleMap.t
add_reset_rules catala_exe_opts rules
adds ninja rules used to reset test files into rules
and returns it.
val add_test_rules :
string ->
Ninja_utils.Rule.t Nj.RuleMap.t ->
Ninja_utils.Rule.t Nj.RuleMap.t
add_test_rules catala_exe_opts rules
adds ninja rules used to test files into rules
and returns it.
val ninja_start : string -> string -> Ninja_utils.ninja
ninja_start catala_exe
returns the inital ninja
data structure with rules needed to reset and test files.
val collect_inline_ninja_builds :
Ninja_utils.ninja ->
string ->
bool ->
(string * Ninja_utils.ninja) option
val collect_all_ninja_build :
Ninja_utils.ninja ->
string ->
bool ->
(string * Ninja_utils.ninja) option
collect_all_ninja_build ninja tested_file catala_exe catala_opts reset_test_outputs
creates and returns all ninja build statements needed to test the tested_file
.
val add_root_test_build :
Ninja_utils.ninja ->
string list ->
string ->
Ninja_utils.ninja
add_root_test_build ninja all_file_names all_test_builds
add the 'test' ninja build declaration calling the rule 'run_and_display_final_message' for all_test_builds
which correspond to all_file_names
.
Directly runs the test (not using ninja, this will be called by ninja rules through the "clerk runtest" command)
type ninja_building_context = {
last_valid_ninja : Ninja_utils.ninja; |
curr_ninja : Ninja_utils.ninja option; |
all_file_names : string list; |
all_test_builds : string; |
all_failed_names : string list; |
}
Record used to keep tracks of the current context while building the Ninja_utils.ninja
.
val ninja_building_context_init : Nj.ninja -> ninja_building_context
ninja_building_context_init ninja_init
returns the empty context corresponding to ninja_init
.
val collect_in_folder :
ninja_building_context ->
string ->
Nj.ninja ->
bool ->
ninja_building_context
collect_in_directory ctx file_or_folder ninja_start reset_test_outputs
updates the building context ctx
by adding new ninja build statements needed to test files in folder
.
val collect_in_file :
ninja_building_context ->
string ->
Nj.ninja ->
bool ->
ninja_building_context
collect_in_file ctx file_or_folder ninja_start reset_test_outputs
updates the building context ctx
by adding new ninja build statements needed to test the tested_file
.
val add_test_builds :
ninja_building_context ->
string list ->
bool ->
ninja_building_context
add_root_test_build ctx files_or_folders reset_test_outputs
updates the ctx
by adding ninja build statements needed to test or reset_test_outputs
files_or_folders
.