Skip to content

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Stevendeo committed Apr 5, 2024
1 parent a91b605 commit 9955e61
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/bin/common/solving_loop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ let recoverable_error ?(code = 1) =
let fatal_error ?(code = 1) =
Format.kasprintf (fun msg -> recoverable_error ~code "%s" msg; exit code)

let exit_as_timeout () = fatal_error ~code:142 "timeout"
let exit_as_timeout ?(code = 142) () = fatal_error ~code "timeout"

let warning (msg : ('a, Format.formatter, unit, unit, unit, 'b) format6) : 'a =
if Options.get_warning_as_error () then
Expand Down Expand Up @@ -208,7 +208,7 @@ let main () =
Frontend.print_status status i;
match status with
| Timeout _ when not (Options.get_timelimit_per_goal ()) ->
exit_as_timeout ()
exit_as_timeout ~code:111 ()
| _ -> raise StopProcessDecl
in
let () =
Expand Down Expand Up @@ -256,7 +256,7 @@ let main () =
with Util.Timeout ->
(* It is still necessary to leave this catch here, because we may
trigger this exception in between calls of the sat solver. *)
if not (Options.get_timelimit_per_goal()) then exit_as_timeout ();
if not (Options.get_timelimit_per_goal()) then exit_as_timeout ~code:112 ();
Unknown None
in

Expand Down Expand Up @@ -337,7 +337,7 @@ let main () =
with
| Util.Timeout ->
Frontend.print_status (Timeout None) 0;
exit_as_timeout ()
exit_as_timeout ~code:113 ()
| Parsing.Parse_error ->
(* TODO(Steven): displaying a dummy value is a bad idea.
This should only be executed with the legacy frontend, which should
Expand Down Expand Up @@ -390,7 +390,7 @@ let main () =
Options.Time.unset_timeout ();
with Util.Timeout ->
Frontend.print_status (Timeout None) 0;
exit_as_timeout ()
exit_as_timeout ~code:114 ()
in

let solver_ctx_key: solver_ctx State.key =
Expand Down Expand Up @@ -488,7 +488,7 @@ let main () =
recoverable_error "%t" msg; st
| Util.Timeout ->
Printer.print_status_timeout None None None None;
exit_as_timeout ()
exit_as_timeout ~code:115 ()
| Errors.Error e ->
recoverable_error "%a" Errors.report e;
st
Expand Down Expand Up @@ -1466,7 +1466,7 @@ let main () =
Options.Time.start ();
Options.Time.set_timeout (Options.get_timelimit ());
end
else exit_as_timeout ()
else exit_as_timeout ~code:116 ()
in
st
| {
Expand All @@ -1483,7 +1483,7 @@ let main () =
Options.Time.start ();
Options.Time.set_timeout (Options.get_timelimit ());
end
else exit_as_timeout ()
else exit_as_timeout ~code:117 ()
in
st
| {contents; _ } ->
Expand Down

0 comments on commit 9955e61

Please sign in to comment.