@@ -25,11 +25,12 @@ let parse_file filename =
2525 in
2626 List. rev files
2727
28- let run ~debug ~dry ~print_statistics ~no_strict_status ~solver_type
29- ~solver_mode ~from_file ~filenames =
30- if debug then Logs.Src. set_level Log. src (Some Logs. Debug );
28+ let run (s : Settings.Run.t ) =
29+ (* ~debug ~dry ~print_statistics ~no_strict_status ~solver_type *)
30+ (* ~solver_mode ~from_file ~filenames = *)
31+ if s.debug then Logs.Src. set_level Log. src (Some Logs. Debug );
3132 Logs. set_reporter @@ Logs. format_reporter () ;
32- let module Solver = (val get_solver debug solver_type solver_mode) in
33+ let module Solver = (val get_solver s. debug s. solver_type s. solver_mode) in
3334 let module Interpret = Interpret. Make (Solver ) in
3435 let total_tests = ref 0 in
3536 let total_t = ref 0. in
@@ -40,7 +41,7 @@ let run ~debug ~dry ~print_statistics ~no_strict_status ~solver_type
4041 incr total_tests;
4142 let start_t = Unix. gettimeofday () in
4243 Fun. protect ~finally: (fun () ->
43- if print_statistics then (
44+ if s. print_statistics then (
4445 let exec_t = Unix. gettimeofday () -. start_t in
4546 total_t := ! total_t +. exec_t;
4647 Log. app (fun m -> m " Run %a in %.06f" Fpath. pp file exec_t) ) )
@@ -50,8 +51,9 @@ let run ~debug ~dry ~print_statistics ~no_strict_status ~solver_type
5051 with Parse. Syntax_error err -> Error (`Parsing_error (file, err))
5152 in
5253 match ast with
53- | Ok _ when dry -> state
54- | Ok ast -> Some (Interpret. start ?state ast ~no_strict_status )
54+ | Ok _ when s.dry -> state
55+ | Ok ast ->
56+ Some (Interpret. start ?state ast ~no_strict_status: s.no_strict_status)
5557 | Error (`Parsing_error ((fpath , err_msg ) as err )) ->
5658 Log. err (fun k -> k " %a: %s" Fpath. pp fpath err_msg);
5759 incr exception_count;
@@ -83,16 +85,16 @@ let run ~debug ~dry ~print_statistics ~no_strict_status ~solver_type
8385 prev_state )
8486 in
8587 let _ =
86- match from_file with
87- | None -> List. fold_left run_path None filenames
88+ match s. from_file with
89+ | None -> List. fold_left run_path None s. filenames
8890 | Some file -> (
8991 match parse_file file with
9092 | Error (`Msg err ) ->
9193 Log. err (fun k -> k " %s" err);
9294 None
9395 | Ok files -> List. fold_left run_file None files )
9496 in
95- if print_statistics then Log. app (fun k -> k " total time: %.06f" ! total_t);
97+ if s. print_statistics then Log. app (fun k -> k " total time: %.06f" ! total_t);
9698 let write_exception_log =
9799 let open Smtml_prelude.Result in
98100 function
0 commit comments