1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859open!ImportopenModel(** Running tests have their output hidden by default to avoid cluttering the
Alcotest display with irrelevant output. However, we (usually) want to keep
the logs on disk so that we can re-display them if a test fails. Logs are
stored with the following structure:
{[
<log_capture_root_dir>
├── run/
│ └── <suite_name>/
│ ├── 20261106-101455-E0965BF9/...
│ └── 20261106-101502-6DDB68D5/ ;; time and ID of each run
│ ├── alpha.000.output ;; ... containing files for
│ ├── alpha.001.output ;; individual tests, named
│ └── beta.000.output ;; <test_name>.<index>.output.
└── latest/ ;; Symlink to the most recent run
]} *)moduletypeS=sigtype'apromisetypetvalinactive:tvalactive:root:string->uuid:string->suite_name:string->tvalwith_captured_logs:t->Test_name.t->('a->'bpromise)->'a->'bpromise(** Capture all logs for a given test run. *)valrecover_logs:t->tail:[`Unlimited|`Limitofint]->Test_name.t->(Format.formatter->unit)option(** Print the logs for a given test to the given formatter, if they exist.
[tail] determines whether to show all lines in the captured log or just a
suffix of them. *)valrun_dir:t->stringoption(** The folder of the current test run, if traces are recorded. *)valpp_current_run_dir:t->Format.formatter->unit(** Print the folder containing all captured traces for the current test run.
Raises an exception if traces are not being recorded. *)valpp_log_location:t->Test_name.t->Format.formatter->unit(** Print the file containing the trace of a particular test. Raises an
exception if traces are not being recorded. *)endmoduletypeLog_trap=sigmoduletypeS=SmoduleMake(Promise:Monad.EXTENDED)(_:Platform.Swithtype'apromise:='aPromise.t):Swithtype'apromise:='aPromise.tend