summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib-runtime-events/test_caml_exception.ml
blob: e1df5aee0bed840d0b8d9238296ec3aa48d6c9cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
(* TEST
include runtime_events
*)
open Runtime_events

exception Test_exception

let runtime_begin domain_id ts phase =
    match phase with
    | EV_MINOR ->
      raise Test_exception
    | _ -> ()

let () =
    start ();
    let cursor = create_cursor None in
    let callbacks = Callbacks.create ~runtime_begin ()
    in
    Gc.full_major ();
    try begin
      ignore(read_poll cursor callbacks None);
      Printf.printf "Exception ignored"
    end with
      Test_exception -> Printf.printf "OK"