Skip to content

Commit

Permalink
Add a test for ocaml#587
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Ludlam <jon@recoil.org>
  • Loading branch information
jonludlam committed Feb 25, 2021
1 parent 3d40f62 commit 523b6f5
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/xref2/dune
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@

(cram
(deps %{bin:odoc} %{bin:odoc_print} %{bin:compile}))

(subdir
v408_and_above
(cram
(enabled_if
(>= %{ocaml_version} 4.08.0))))

4 changes: 4 additions & 0 deletions test/xref2/v408_and_above/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(cram
(deps %{bin:odoc} %{bin:odoc_print} %{bin:compile}))


7 changes: 7 additions & 0 deletions test/xref2/v408_and_above/github_issue_587.t/a_intf.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module type S = sig
module Foo : sig end
end

module type A = sig
module type S = S
end
1 change: 1 addition & 0 deletions test/xref2/v408_and_above/github_issue_587.t/b.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include B_intf.B
13 changes: 13 additions & 0 deletions test/xref2/v408_and_above/github_issue_587.t/b_intf.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module Bar = struct end

module type S = sig
include A_intf.S

module Foo : sig end
end

module type B = sig
module type S = S

include S
end
19 changes: 19 additions & 0 deletions test/xref2/v408_and_above/github_issue_587.t/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/sh

OCAMLC=ocamlc
ODOC=odoc

$OCAMLC -w -49 -no-alias-deps -c odoc_bug__.ml -bin-annot

for f in a_intf b_intf; do
$OCAMLC -c $f.ml -bin-annot -g -no-alias-deps -open Odoc_bug__ -o odoc_bug__$f
done

for f in b c; do
$OCAMLC -c -intf $f.mli -bin-annot -no-alias-deps -open Odoc_bug__ -o odoc_bug__$f
done

for f in .cmt a_intf.cmt b_intf.cmt b.cmti c.cmti; do
odoc compile odoc_bug__$f -I . --pkg odoc_bug
done

1 change: 1 addition & 0 deletions test/xref2/v408_and_above/github_issue_587.t/c.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include B.S
3 changes: 3 additions & 0 deletions test/xref2/v408_and_above/github_issue_587.t/odoc_bug__.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module A_intf = Odoc_bug__a_intf
module B = Odoc_bug__b
module B_intf = Odoc_bug__b_intf
32 changes: 32 additions & 0 deletions test/xref2/v408_and_above/github_issue_587.t/run.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
A quick test to repro the issue found in #587

$ ./build.sh
odoc: internal error, uncaught exception:
Failure("Error")
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
Called from Odoc_xref2__Subst.rename_bound_idents.new_module_id in file "src/xref2/subst.ml", line 771, characters 13-29
Called from Odoc_xref2__Subst.rename_bound_idents.(fun) in file "src/xref2/subst.ml", line 809, characters 16-32
Called from Odoc_xref2__Subst.rename_bound_idents.(fun) in file "src/xref2/subst.ml", line 868, characters 8-69
Called from Odoc_xref2__Subst.signature in file "src/xref2/subst.ml", line 907, characters 17-50
Called from Odoc_xref2__Subst.simple_expansion in file "src/xref2/subst.ml", line 503, characters 30-46
Called from Odoc_xref2__Subst.option_ in file "src/xref2/subst.ml", line 412, characters 51-61
Called from Odoc_xref2__Subst.module_type_expr in file "src/xref2/subst.ml", line 599, characters 24-62
Called from Odoc_xref2__Subst.module_type in file "src/xref2/subst.ml", line 509, characters 37-59
Called from Odoc_xref2__Tools.handle_module_type_lookup.(fun) in file "src/xref2/tools.ml", line 415, characters 13-37
Called from Odoc_xref2__Tools.resolve_module_type.(fun) in file "src/xref2/tools.ml", line 708, characters 8-68
Called from Odoc_xref2__Expand_tools.aux_expansion_of_u_module_type_expr in file "src/xref2/expand_tools.ml", line 111, characters 6-61
Called from Odoc_xref2__Compile.include_.get_expansion in file "src/xref2/compile.ml", line 325, characters 10-66
Called from Odoc_xref2__Compile.signature_items.(fun) in file "src/xref2/compile.ml", line 240, characters 21-35
Called from Stdlib__list.fold_left in file "list.ml", line 121, characters 24-34
Called from Odoc_xref2__Compile.signature_items in file "src/xref2/compile.ml", line 204, characters 4-1023
Called from Odoc_xref2__Compile.signature in file "src/xref2/compile.ml", line 273, characters 16-46
Called from Odoc_xref2__Compile.content.(fun) in file "src/xref2/compile.ml", line 66, characters 13-54
Called from Odoc_xref2__Compile.unit in file "src/xref2/compile.ml", line 59, characters 21-47
Called from Odoc_xref2__Lookup_failures.catch_failures in file "src/xref2/lookup_failures.ml", line 18, characters 10-14
Called from Odoc_odoc__Compile.resolve_and_substitute.(fun) in file "src/odoc/compile.ml", line 74, characters 2-37
Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 25, characters 19-24
Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 23, characters 12-19
Called from Cmdliner.Term.run in file "cmdliner.ml", line 117, characters 32-39
[2]


0 comments on commit 523b6f5

Please # to comment.