Skip to content

Commit c7aa7ac

Browse files
committed
Lin: Print commands that trigger uncaught exceptions
The standard QCheck mechanism to catch exceptions that are raised in tests do not give much clue about the source (ie Lin command) of that exception This packs the unsoundly-specified command with the exception in such a case so that it can be displayed Before: ``` exception Failure("unexpected") ``` After: ``` exception Failure("unexpected") raised but not caught while running always_fail t ```
1 parent ce34434 commit c7aa7ac

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/lin.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ module MakeCmd (ApiSpec : Spec) : Internal.CmdSpec = struct
479479
apply_f (f arg) rem state
480480

481481
let run cmd state =
482-
let Cmd { args ; rty ; f ; _ } = cmd in
483-
Res (rty, apply_f f args state)
482+
Util.tag_exn_with show_cmd
483+
(fun cmd ->
484+
let (Cmd { args; rty; f; _ }) = cmd in
485+
Res (rty, apply_f f args state))
486+
cmd
484487
end

0 commit comments

Comments
 (0)