Skip to content

Commit

Permalink
Robustify tests for @doc-new
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Ludlam <[email protected]>
  • Loading branch information
jonludlam committed Oct 19, 2023
1 parent bc1f86d commit 1fc882f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
$ dune build @doc-new

$ grep Test _build/default/_doc_new/html/docs/local/hello_world/index.html
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>hello_world (docs.local.hello_world)</title><link rel="stylesheet" href="../../odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> – <a href="../../index.html">docs</a> &#x00BB; <a href="../index.html">local</a> &#x00BB; hello_world</nav><header class="odoc-preamble"><h1 id="test-index"><a href="#test-index" class="anchor"></a>Test index</h1></header><div class="odoc-content"></div></body></html>
$ grep Test _build/default/_doc_new/html/docs/local/hello_world/index.html > /dev/null || echo Missing
5 changes: 0 additions & 5 deletions test/blackbox-tests/test-cases/odoc/new/odoc-simple.t/dune
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
(modes byte)
(public_name foo.byte))

(alias
(name runtest)
(deps _doc_new/html/docs/index.html)
(action (echo "%{read:_doc_new/html/docs/index.html}")))

(alias
(name foo-mld)
(deps _doc_new/index/local/foo/foo.mld)
Expand Down
16 changes: 5 additions & 11 deletions test/blackbox-tests/test-cases/odoc/new/odoc-simple.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,16 @@ This test generates documentation using odoc for a library:
$ dune build @doc-new

This test if `.odocl` files are generated
$ find _build/default/_doc_new/odoc -name '*.odocl' | sort -n
$ find _build/default/_doc_new/odoc/local -name '*.odocl' | sort -n
_build/default/_doc_new/odoc/local/bar/bar.odocl
_build/default/_doc_new/odoc/local/foo/byte/foo_byte.odocl
_build/default/_doc_new/odoc/local/foo/foo.odocl
_build/default/_doc_new/odoc/local/foo/foo2.odocl
_build/default/_doc_new/odoc/stdlib/camlinternalFormat.odocl
_build/default/_doc_new/odoc/stdlib/camlinternalFormatBasics.odocl
_build/default/_doc_new/odoc/stdlib/camlinternalLazy.odocl
_build/default/_doc_new/odoc/stdlib/camlinternalMod.odocl
_build/default/_doc_new/odoc/stdlib/camlinternalOO.odocl
_build/default/_doc_new/odoc/stdlib/std_exit.odocl
_build/default/_doc_new/odoc/stdlib/stdlib.odocl

$ dune runtest
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>docs (docs)</title><link rel="stylesheet" href="odoc.support/odoc.css"/><meta charset="utf-8"/><meta name="generator" content="odoc 2.2.1"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><header class="odoc-preamble"><h1 id="docs"><a href="#docs" class="anchor"></a>Docs</h1></header><nav class="odoc-toc"><ul><li><a href="#local-packages">Local Packages</a></li><li><a href="#switch-installed-packages">Switch-installed packages</a></li></ul></nav><div class="odoc-content"><h2 id="local-packages"><a href="#local-packages" class="anchor"></a>Local Packages</h2><ul><li><a href="local/bar/index.html"><code>bar</code></a></li><li><a href="local/foo/index.html"><code>foo</code></a></li></ul><h2 id="switch-installed-packages"><a href="#switch-installed-packages" class="anchor"></a>Switch-installed packages</h2><ul><li><a href="stdlib/index.html"><code>stdlib</code></a></li></ul></div></body></html>
$ ls _build/default/_doc_new/html/docs/local/
bar
foo
index.html

$ dune build @foo-mld
{0 Package foo}
Expand Down

0 comments on commit 1fc882f

Please sign in to comment.