1#!/bin/sh
2
3# Make sure the doxygen documentation builds without warnings
4#
5# Copyright The Mbed TLS Contributors
6# SPDX-License-Identifier: Apache-2.0
7#
8# Licensed under the Apache License, Version 2.0 (the "License"); you may
9# not use this file except in compliance with the License.
10# You may obtain a copy of the License at
11#
12# http://www.apache.org/licenses/LICENSE-2.0
13#
14# Unless required by applicable law or agreed to in writing, software
15# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17# See the License for the specific language governing permissions and
18# limitations under the License.
19
20# Abort on errors (and uninitiliased variables)
21set -eu
22
23if [ -d library -a -d include -a -d tests ]; then :; else
24    echo "Must be run from mbed TLS root" >&2
25    exit 1
26fi
27
28if scripts/apidoc_full.sh > doc.out 2>doc.err; then :; else
29    cat doc.err
30    echo "FAIL" >&2
31    exit 1;
32fi
33
34cat doc.out doc.err | \
35    grep -v "warning: ignoring unsupported tag" \
36    > doc.filtered
37
38if egrep "(warning|error):" doc.filtered; then
39    echo "FAIL" >&2
40    exit 1;
41fi
42
43make apidoc_clean
44rm -f doc.out doc.err doc.filtered
45