Skip to content

Commit 49b9fe2

Browse files
committed
test if dune does not generate docs for hidden modules
Signed-off-by: lubegasimon <[email protected]>
1 parent ada8969 commit 49b9fe2

File tree

7 files changed

+26
-1
lines changed

7 files changed

+26
-1
lines changed

test/blackbox-tests/test-cases/odoc/odoc-simple.t/run.t

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ This test generates documentation using odoc for a library:
44

55
This test if `.odocl` files are generated
66
$ find _build/default/_doc/_odocls -name '*.odocl'
7-
_build/default/_doc/_odocls/foo/foo3.odocl
87
_build/default/_doc/_odocls/foo/foo_byte.odocl
98
_build/default/_doc/_odocls/foo/page-index.odocl
109
_build/default/_doc/_odocls/foo/foo2.odocl

test/blackbox-tests/test-cases/odoc/odoc-wrapped-lib.t/bar.ml

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(library
2+
(public_name foo))
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(lang dune 1.10)

test/blackbox-tests/test-cases/odoc/odoc-wrapped-lib.t/foo.ml

Whitespace-only changes.

test/blackbox-tests/test-cases/odoc/odoc-wrapped-lib.t/foo.opam

Whitespace-only changes.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
This test generates documentation for non-hidden modules only for a library:
2+
3+
$ ocamlc -c -bin-annot foo.ml
4+
5+
$ dune build @doc
6+
7+
Hidden modules should be compiled
8+
$ find _build/default -name '*.odoc'
9+
_build/default/_doc/_odoc/pkg/foo/page-index.odoc
10+
_build/default/.foo.objs/byte/foo__Bar.odoc
11+
_build/default/.foo.objs/byte/foo__.odoc
12+
_build/default/.foo.objs/byte/foo.odoc
13+
14+
Hidden modules should not be linked
15+
$ find _build/default -name '*.odocl'
16+
_build/default/_doc/_odocls/foo/page-index.odocl
17+
_build/default/_doc/_odocls/foo/foo.odocl
18+
19+
We don't expect html for hidden modules
20+
$ find _build/default -name '*.html'
21+
_build/default/_doc/_html/index.html
22+
_build/default/_doc/_html/foo/index.html
23+
_build/default/_doc/_html/foo/Foo/index.html

0 commit comments

Comments
 (0)