File: run.t

package info (click to toggle)
ocaml-odoc 3.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 12,104 kB
  • sloc: ml: 59,291; javascript: 2,572; sh: 566; makefile: 31
file content (47 lines) | stat: -rw-r--r-- 1,711 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Test the behavior of warnings generated while compiling and linking.

  $ ocamlc -c -bin-annot b.mli
  $ ocamlc -c -bin-annot a.mli

A contains both parsing errors and a reference to B that isn't compiled yet:

  $ odoc compile --warn-error --package test a.cmti
  File "a.mli", line 8, characters 20-23:
  Error: Open bracket '{!' is never closed.
  File "a.mli", line 8, characters 22-23:
  Error: Identifier in reference should not be empty.
  ERROR: Warnings have been generated.
  [1]

  $ odoc compile --package test b.cmti
  $ odoc compile --package test a.cmti
  File "a.mli", line 8, characters 20-23:
  Warning: Open bracket '{!' is never closed.
  File "a.mli", line 8, characters 22-23:
  Warning: Identifier in reference should not be empty.

  $ odoc errors a.odoc
  File "a.mli", line 8, characters 20-23:
  Open bracket '{!' is never closed.
  File "a.mli", line 8, characters 22-23:
  Identifier in reference should not be empty.

A contains linking errors:

  $ odoc link a.odoc --enable-missing-root-warning
  File "a.mli", line 6, characters 47-65:
  Warning: Failed to resolve reference unresolvedroot(B).doesn't_exist Couldn't find "doesn't_exist"

  $ odoc errors a.odocl
  File "a.mli", line 8, characters 20-23:
  Open bracket '{!' is never closed.
  File "a.mli", line 8, characters 22-23:
  Identifier in reference should not be empty.
  File "a.mli", line 6, characters 47-65:
  Failed to resolve reference unresolvedroot(B).doesn't_exist Couldn't find "doesn't_exist"

It is possible to hide the warnings too:

  $ odoc compile --print-warnings false --package test a.cmti
  $ odoc link --print-warnings false a.odoc
  $ ODOC_PRINT_WARNINGS=false odoc compile --package test a.cmti