Skip to content

Commit

Permalink
regression test for #9701
Browse files Browse the repository at this point in the history
  • Loading branch information
gasche committed Jun 23, 2020
1 parent 607bd8d commit f0fae66
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
22 changes: 22 additions & 0 deletions testsuite/tests/backtrace/toplevel_script_backtrace.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(* TEST
ocaml_script_as_argument = "true"
ocaml_exit_status = "2"
* toplevel
*)

(* Make the test reproducible regardless of whether OCAMLRUNPARAM=b or not *)
Printexc.record_backtrace true;;

let () =
(* regression test for #9701 *)
Format.pp_print_text Format.std_formatter
"This test is currently not working at expected: \
it does not include proper backtrace locations for \
the exception raised in the ocaml script file. \
See 'Called from unknown location' in \
toplevel_script_backtrace.ocaml.reference";
Format.printf "@."

let f () = failwith "test"
let proc () = f ()
let () = proc ()
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This test is currently not working at expected: it does not include proper
backtrace locations for the exception raised in the ocaml script file. See
'Called from unknown location' in
toplevel_script_backtrace.ocaml.reference
Exception: Failure "test".
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
Called from unknown location
Called from Toploop.load_lambda in file "toplevel/toploop.ml", line 212, characters 17-27

0 comments on commit f0fae66

Please sign in to comment.