Skip to content

Commit 7dd70b4

Browse files
vouillonOlivierNicole
authored andcommitted
Make the tests for uncaught exceptions more portable
1 parent 7221b9c commit 7dd70b4

File tree

11 files changed

+28
-14
lines changed

11 files changed

+28
-14
lines changed

compiler/tests-check-prim/main.output

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ caml_build_symbols
197197
caml_is_printable
198198
caml_maybe_print_stats
199199
caml_register_global
200+
caml_unregister_named_value
200201

201202
From +str.js:
202203
caml_str_initialize

compiler/tests-check-prim/main.output5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ caml_build_symbols
150150
caml_is_printable
151151
caml_maybe_print_stats
152152
caml_register_global
153+
caml_unregister_named_value
153154

154155
From +str.js:
155156
caml_str_initialize

compiler/tests-check-prim/unix-unix.output

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,7 @@ caml_build_symbols
306306
caml_is_printable
307307
caml_maybe_print_stats
308308
caml_register_global
309+
caml_unregister_named_value
309310

310311
From +str.js:
311312
caml_str_initialize

compiler/tests-check-prim/unix-unix.output5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ caml_build_symbols
261261
caml_is_printable
262262
caml_maybe_print_stats
263263
caml_register_global
264+
caml_unregister_named_value
264265

265266
From +str.js:
266267
caml_str_initialize

compiler/tests-check-prim/unix-win32.output

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ caml_build_symbols
271271
caml_is_printable
272272
caml_maybe_print_stats
273273
caml_register_global
274+
caml_unregister_named_value
274275

275276
From +str.js:
276277
caml_str_initialize

compiler/tests-check-prim/unix-win32.output5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ caml_build_symbols
227227
caml_is_printable
228228
caml_maybe_print_stats
229229
caml_register_global
230+
caml_unregister_named_value
230231

231232
From +str.js:
232233
caml_str_initialize

compiler/tests-jsoo/bin/dune

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
(executables
22
(names error1 error2 error3)
3-
(modes byte js))
3+
(modes js)
4+
(libraries js_of_ocaml))
45

56
(rule
67
(target error1.actual)

compiler/tests-jsoo/bin/error1.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
external unregister : string -> unit = "caml_unregister_named_value"
2+
13
let () =
24
match Array.to_list Sys.argv with
3-
| _ :: "unregister" :: _ ->
4-
let null = Array.unsafe_get [| 1 |] 1 in
5-
Callback.register "Printexc.handle_uncaught_exception" null
5+
| _ :: "unregister" :: _ -> unregister "Printexc.handle_uncaught_exception"
66
| _ -> ()
77

88
exception D of int * string * Int64.t

compiler/tests-jsoo/bin/error2.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
external unregister : string -> unit = "caml_unregister_named_value"
2+
13
let () =
24
(* Make sure Printexc is linked *)
35
let _ = Printexc.to_string Not_found in
46
match Array.to_list Sys.argv with
5-
| _ :: "unregister" :: _ ->
6-
let null = Array.unsafe_get [| 1 |] 1 in
7-
Callback.register "Printexc.handle_uncaught_exception" null
7+
| _ :: "unregister" :: _ -> unregister "Printexc.handle_uncaught_exception"
88
| _ -> ()
99

1010
[@@@ocaml.warning "-8"]

compiler/tests-jsoo/bin/error3.ml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1+
external unregister : string -> unit = "caml_unregister_named_value"
2+
13
let () =
24
match Array.to_list Sys.argv with
3-
| _ :: "unregister" :: _ ->
4-
let null = Array.unsafe_get [| 1 |] 1 in
5-
Callback.register "Printexc.handle_uncaught_exception" null
5+
| _ :: "unregister" :: _ -> unregister "Printexc.handle_uncaught_exception"
66
| _ -> ()
77

8-
let null : _ -> _ -> _ = Array.unsafe_get [||] 0
9-
10-
let _ = null 1 2
8+
let _ = (Obj.magic Js_of_ocaml.Js.null : int -> int -> unit) 1 2

0 commit comments

Comments
 (0)