Skip to content

Commit a3b579e

Browse files
Leonidas-from-XIVjonludlam
authored andcommitted
Add OxCaml implementation file test
This adds a file that contains just an implementation, without an interface, to show how OxCaml code is rendered.
1 parent da35f94 commit a3b579e

13 files changed

Lines changed: 241 additions & 0 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let[@zero_alloc] add b x y = if b then x + y else x

test/generators/gen_rules/gen_rules.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ let constraints =
6969
("functor_ml.ml", Min "4.14");
7070
("ocaml_55.mli", Min "5.5");
7171
("oxcaml.mli", OxCaml);
72+
("oxcaml_impl.ml", OxCaml);
7273
]
7374

7475
let test_cases_dir = Fpath.v "cases"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html xmlns="http://www.w3.org/1999/xhtml">
3+
<head><title>Oxcaml_impl (Oxcaml_impl)</title><meta charset="utf-8"/>
4+
<link rel="stylesheet" href="odoc.css"/>
5+
<meta name="generator" content="odoc %%VERSION%%"/>
6+
<meta name="viewport" content="width=device-width,initial-scale=1.0"/>
7+
<script src="highlight.pack.js"></script>
8+
<script>hljs.initHighlightingOnLoad();</script>
9+
</head>
10+
<body class="odoc">
11+
<nav class="odoc-nav"><a href="index.html">Up</a>
12+
<a href="index.html">Index</a> &#x00BB; Oxcaml_impl
13+
</nav>
14+
<header class="odoc-preamble">
15+
<h1>Module <code><span>Oxcaml_impl</span></code></h1>
16+
</header>
17+
<div class="odoc-content">
18+
<div class="odoc-spec">
19+
<div class="spec value anchored" id="val-add">
20+
<a href="#val-add" class="anchor"></a>
21+
<code>
22+
<span><span class="keyword">val</span> add :
23+
<span>bool <span class="arrow">&#45;&gt;</span></span>
24+
<span>int <span class="arrow">&#45;&gt;</span></span>
25+
<span>int <span class="arrow">&#45;&gt;</span></span> int
26+
</span>
27+
</code>
28+
</div>
29+
</div>
30+
</div>
31+
</body>
32+
</html>

test/generators/html/Oxcaml_impl.md

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Oxcaml_impl.html

test/generators/latex/Oxcaml_impl.md

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
\section{Module \ocamlinlinecode{Oxcaml\_\allowbreak{}impl}}\label{Oxcaml_impl}%
2+
\label{Oxcaml_impl--val-add}\ocamlcodefragment{\ocamltag{keyword}{val} add : bool \ocamltag{arrow}{$\rightarrow$} int \ocamltag{arrow}{$\rightarrow$} int \ocamltag{arrow}{$\rightarrow$} int}\\
3+
4+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Oxcaml_impl.tex

test/generators/link.dune.inc

Lines changed: 179 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,27 @@
611611
(run odoc link -o %{target} %{dep:oxcaml.odoc}))
612612
(enabled_if %{ocaml-config:ox}))
613613

614+
(rule
615+
(target oxcaml_impl.cmt)
616+
(package odoc)
617+
(action
618+
(run ocamlc -c -bin-annot -o %{target} %{dep:cases/oxcaml_impl.ml}))
619+
(enabled_if %{ocaml-config:ox}))
620+
621+
(rule
622+
(target oxcaml_impl.odoc)
623+
(package odoc)
624+
(action
625+
(run odoc compile -o %{target} %{dep:oxcaml_impl.cmt}))
626+
(enabled_if %{ocaml-config:ox}))
627+
628+
(rule
629+
(target oxcaml_impl.odocl)
630+
(package odoc)
631+
(action
632+
(run odoc link -o %{target} %{dep:oxcaml_impl.odoc}))
633+
(enabled_if %{ocaml-config:ox}))
634+
614635
(rule
615636
(target recent.cmti)
616637
(package odoc)
@@ -12060,6 +12081,164 @@
1206012081
(diff oxcaml.targets oxcaml.targets.gen))
1206112082
(enabled_if %{ocaml-config:ox})))
1206212083

12084+
(subdir
12085+
html
12086+
(rule
12087+
(targets Oxcaml_impl.html.gen)
12088+
(package odoc)
12089+
(action
12090+
(run
12091+
odoc
12092+
html-generate
12093+
--indent
12094+
--flat
12095+
--extra-suffix
12096+
gen
12097+
-o
12098+
.
12099+
%{dep:../oxcaml_impl.odocl}))
12100+
(enabled_if %{ocaml-config:ox}))
12101+
(rule
12102+
(alias runtest)
12103+
(package odoc)
12104+
(action
12105+
(diff Oxcaml_impl.html Oxcaml_impl.html.gen))
12106+
(enabled_if %{ocaml-config:ox})))
12107+
12108+
(subdir
12109+
html
12110+
(rule
12111+
(target oxcaml_impl.targets.gen)
12112+
(package odoc)
12113+
(action
12114+
(with-outputs-to
12115+
oxcaml_impl.targets.gen
12116+
(run odoc html-targets -o . %{dep:../oxcaml_impl.odocl} --flat)))
12117+
(enabled_if %{ocaml-config:ox}))
12118+
(rule
12119+
(alias runtest)
12120+
(package odoc)
12121+
(action
12122+
(diff oxcaml_impl.targets oxcaml_impl.targets.gen))
12123+
(enabled_if %{ocaml-config:ox})))
12124+
12125+
(subdir
12126+
latex
12127+
(rule
12128+
(targets Oxcaml_impl.tex.gen)
12129+
(package odoc)
12130+
(action
12131+
(run
12132+
odoc
12133+
latex-generate
12134+
-o
12135+
.
12136+
--extra-suffix
12137+
gen
12138+
%{dep:../oxcaml_impl.odocl}))
12139+
(enabled_if %{ocaml-config:ox}))
12140+
(rule
12141+
(alias runtest)
12142+
(package odoc)
12143+
(action
12144+
(diff Oxcaml_impl.tex Oxcaml_impl.tex.gen))
12145+
(enabled_if %{ocaml-config:ox})))
12146+
12147+
(subdir
12148+
latex
12149+
(rule
12150+
(target oxcaml_impl.targets.gen)
12151+
(package odoc)
12152+
(action
12153+
(with-outputs-to
12154+
oxcaml_impl.targets.gen
12155+
(run odoc latex-targets -o . %{dep:../oxcaml_impl.odocl})))
12156+
(enabled_if %{ocaml-config:ox}))
12157+
(rule
12158+
(alias runtest)
12159+
(package odoc)
12160+
(action
12161+
(diff oxcaml_impl.targets oxcaml_impl.targets.gen))
12162+
(enabled_if %{ocaml-config:ox})))
12163+
12164+
(subdir
12165+
man
12166+
(rule
12167+
(targets Oxcaml_impl.3o.gen)
12168+
(package odoc)
12169+
(action
12170+
(run
12171+
odoc
12172+
man-generate
12173+
-o
12174+
.
12175+
--extra-suffix
12176+
gen
12177+
%{dep:../oxcaml_impl.odocl}))
12178+
(enabled_if %{ocaml-config:ox}))
12179+
(rule
12180+
(alias runtest)
12181+
(package odoc)
12182+
(action
12183+
(diff Oxcaml_impl.3o Oxcaml_impl.3o.gen))
12184+
(enabled_if %{ocaml-config:ox})))
12185+
12186+
(subdir
12187+
man
12188+
(rule
12189+
(target oxcaml_impl.targets.gen)
12190+
(package odoc)
12191+
(action
12192+
(with-outputs-to
12193+
oxcaml_impl.targets.gen
12194+
(run odoc man-targets -o . %{dep:../oxcaml_impl.odocl})))
12195+
(enabled_if %{ocaml-config:ox}))
12196+
(rule
12197+
(alias runtest)
12198+
(package odoc)
12199+
(action
12200+
(diff oxcaml_impl.targets oxcaml_impl.targets.gen))
12201+
(enabled_if %{ocaml-config:ox})))
12202+
12203+
(subdir
12204+
markdown
12205+
(rule
12206+
(targets Oxcaml_impl.md.gen)
12207+
(package odoc)
12208+
(action
12209+
(run
12210+
odoc
12211+
markdown-generate
12212+
-o
12213+
.
12214+
--extra-suffix
12215+
gen
12216+
%{dep:../oxcaml_impl.odocl}))
12217+
(enabled_if %{ocaml-config:ox}))
12218+
(rule
12219+
(alias runtest)
12220+
(package odoc)
12221+
(action
12222+
(diff Oxcaml_impl.md Oxcaml_impl.md.gen))
12223+
(enabled_if %{ocaml-config:ox})))
12224+
12225+
(subdir
12226+
markdown
12227+
(rule
12228+
(target oxcaml_impl.targets.gen)
12229+
(package odoc)
12230+
(action
12231+
(with-outputs-to
12232+
oxcaml_impl.targets.gen
12233+
(run odoc markdown-targets -o . %{dep:../oxcaml_impl.odocl})))
12234+
(enabled_if %{ocaml-config:ox}))
12235+
(rule
12236+
(alias runtest)
12237+
(package odoc)
12238+
(action
12239+
(diff oxcaml_impl.targets oxcaml_impl.targets.gen))
12240+
(enabled_if %{ocaml-config:ox})))
12241+
1206312242
(subdir
1206412243
html
1206512244
(rule

test/generators/man/Oxcaml_impl.3o

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
.TH Oxcaml_impl 3 "" "Odoc" "OCaml Library"
3+
.SH Name
4+
Oxcaml_impl
5+
.SH Synopsis
6+
.sp
7+
.in 2
8+
\fBModule Oxcaml_impl\fR
9+
.in
10+
.sp
11+
.SH Documentation
12+
.sp
13+
.nf
14+
\f[CB]val\fR add : bool \f[CB]\->\fR int \f[CB]\->\fR int \f[CB]\->\fR int

0 commit comments

Comments
 (0)