Skip to content

Commit

Permalink
fix #272
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Heuzard committed Apr 28, 2022
1 parent 75f6336 commit 4807646
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/alcotest-engine/log_trap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -63,24 +63,29 @@ struct
in
ListLabels.iter display_lines ~f:(Fmt.pf ppf "%s@\n")

let log_dir { suite_name; uuid; root } =
let log_dir { suite_name = _; uuid; root } =
Filename.concat root uuid

let log_dir_pretty { suite_name; uuid; root } =
(* We don't create symlinks on Windows. *)
let via_symlink = not Sys.win32 in
Filename.concat root (if via_symlink then suite_name else uuid)

let output_fpath t tname = Filename.concat (log_dir t) (Test_name.file tname)

let output_fpath_pretty t tname = Filename.concat (log_dir_pretty t) (Test_name.file tname)

let active_or_exn = function
| Active t -> t
| Inactive -> failwith "internal error: no log location"

let pp_current_run_dir t ppf =
let t = active_or_exn t in
pp_path ppf (log_dir t)
pp_path ppf (log_dir_pretty t)

let pp_log_location t tname ppf =
let t = active_or_exn t in
let path = output_fpath t tname in
let path = output_fpath_pretty t tname in
pp_path ppf path

let recover_logs t ~tail tname =
Expand Down

0 comments on commit 4807646

Please sign in to comment.