- let is_error_expected =
- match is_error_expected with
- | None -> (fun _ -> false)
- | Some f -> f
- in
- match f () with
- | exception e ->
- let backtrace = Printexc.get_backtrace () in
- let (exe_stat, exe_msg) =
- (match e with
- | Tiger_error.T e when is_error_expected e ->
- (Pass, (Tiger_error.to_string e))
- | Tiger_error.T e ->
- incr count_fail_all;
- (Fail, (Tiger_error.to_string e))
- | e ->
- incr count_fail_all;
- (Fail, (Printexc.to_string e))
- )
- in
- { exe_stat
- ; exe_msg = s "\n\tException: %s.\n\tBacktrace: %s" exe_msg backtrace
+ let execution = match f () with exception e -> `Exn e | o -> `Out o in
+ (match execution, is_error_expected with
+ | `Exn (Err.T e), Some is_error_expected when is_error_expected e ->
+ { exe_stat = Pass
+ ; exe_msg = ""