summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Refis <thomas.refis@gmail.com>2018-09-06 17:00:56 +0100
committerThomas Refis <thomas.refis@gmail.com>2018-09-07 09:58:55 +0100
commit17d1d782e216b85f910bed9ce2f8627c7dc546e4 (patch)
tree22c386c4d557b669eabf40ceab998a10cd0fa537
parent9e3b813aae5018c2ad9d3ecf11ec5bfc87f1bef7 (diff)
downloadocaml-17d1d782e216b85f910bed9ce2f8627c7dc546e4.tar.gz
expect_test: cleanup typer state
-rw-r--r--testsuite/tests/tool-expect-test/clean_typer.ml3
-rw-r--r--testsuite/tools/Makefile2
-rw-r--r--testsuite/tools/expect_test.ml2
3 files changed, 3 insertions, 4 deletions
diff --git a/testsuite/tests/tool-expect-test/clean_typer.ml b/testsuite/tests/tool-expect-test/clean_typer.ml
index f22f667c7f..3009a17719 100644
--- a/testsuite/tests/tool-expect-test/clean_typer.ml
+++ b/testsuite/tests/tool-expect-test/clean_typer.ml
@@ -72,9 +72,6 @@ Error: This expression has type Variants.bar M.t
let f3 = fbar foo;;
[%%expect {|
-Uncaught exception: Stack overflow
-
-|}, Principal{|
Line 1, characters 14-17:
let f3 = fbar foo;;
^^^
diff --git a/testsuite/tools/Makefile b/testsuite/tools/Makefile
index 97e50ff9b3..c14fade18c 100644
--- a/testsuite/tools/Makefile
+++ b/testsuite/tools/Makefile
@@ -17,7 +17,7 @@ include $(BASEDIR)/../config/Makefile
expect_MAIN=expect_test
expect_PROG=$(expect_MAIN)$(EXE)
expect_COMPFLAGS=-I $(OTOPDIR)/parsing -I $(OTOPDIR)/utils \
- -I $(OTOPDIR)/driver -I $(OTOPDIR)/toplevel
+ -I $(OTOPDIR)/driver -I $(OTOPDIR)/typing -I $(OTOPDIR)/toplevel
expect_LIBRARIES=../../compilerlibs/ocamlcommon \
../../compilerlibs/ocamlbytecomp \
../../compilerlibs/ocamltoplevel
diff --git a/testsuite/tools/expect_test.ml b/testsuite/tools/expect_test.ml
index 2bace33432..2940a32f95 100644
--- a/testsuite/tools/expect_test.ml
+++ b/testsuite/tools/expect_test.ml
@@ -250,6 +250,7 @@ let eval_expect_file _fname ~file_contents =
let _ : bool =
List.fold_left phrases ~init:true ~f:(fun acc phrase ->
acc &&
+ let snap = Btype.snapshot () in
try
exec_phrase ppf phrase
with exn ->
@@ -260,6 +261,7 @@ let eval_expect_file _fname ~file_contents =
(Printexc.to_string exn)
(Printexc.raw_backtrace_to_string bt)
end;
+ Btype.backtrack snap;
false
)
in