summaryrefslogtreecommitdiff
path: root/manual/tests/check-stdlib-modules
blob: 6e9835236608ad1d2f312d27a9b17614655afa17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

TMPDIR="${TMPDIR:-/tmp}"

(cd $1/stdlib; ls -1 *.mli) | sed -e 's/\.mli//' >$TMPDIR/stdlib-$$-files
cut -c 1 $TMPDIR/stdlib-$$-files | tr a-z A-Z >$TMPDIR/stdlib-$$-initials
cut -c 2- $TMPDIR/stdlib-$$-files \
| paste -d '\0' $TMPDIR/stdlib-$$-initials - >$TMPDIR/stdlib-$$-modules

exitcode=0
for i in `cat $TMPDIR/stdlib-$$-modules`; do
  case $i in
    Stdlib | Camlinternal* | *Labels | Obj | Pervasives) continue;;
  esac
  grep -q -e '"'$i'" & p\.~\\pageref{'$i'} &' $1/manual/manual/library/stdlib.etex || {
    echo "Module $i is missing from stdlib.etex." >&2
    exitcode=2
  }
done

rm -f $TMPDIR/stdlib-$$-*

exit $exitcode