summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Refis <thomas.refis@gmail.com>2018-02-19 17:39:41 +0000
committerThomas Refis <thomas.refis@gmail.com>2018-02-19 17:49:22 +0000
commit39b4a73552e26008554d15e8b54f9d06d29a79a9 (patch)
treeccbb558dc53fa9c7125ddd81ac4b12d357cca6f9
parent59a8d4d1be613eb20080abd00ce61f599d1dc679 (diff)
downloadocaml-39b4a73552e26008554d15e8b54f9d06d29a79a9.tar.gz
expect_test: print all the exceptions, even the unexpected ones
-rw-r--r--testsuite/tools/expect_test.ml11
1 files changed, 9 insertions, 2 deletions
diff --git a/testsuite/tools/expect_test.ml b/testsuite/tools/expect_test.ml
index 7d8d05b836..a1cae4f6f5 100644
--- a/testsuite/tools/expect_test.ml
+++ b/testsuite/tools/expect_test.ml
@@ -253,8 +253,15 @@ let eval_expect_file _fname ~file_contents =
try
exec_phrase ppf phrase
with exn ->
- Location.report_exception ppf exn;
- false)
+ let bt = Printexc.get_raw_backtrace () in
+ begin try Location.report_exception ppf exn
+ with _ ->
+ Format.fprintf ppf "Uncaught exception: %s\n%s\n"
+ (Printexc.to_string exn)
+ (Printexc.raw_backtrace_to_string bt)
+ end;
+ false
+ )
in
Format.pp_print_flush ppf ();
let len = Buffer.length buf in