@@ -85,6 +85,25 @@ make_with_tmpdir() {
echo
}
+make_doc_and_clean() {
+ echo -e "\$PWD: $PWD"
+ echo -e "command: make -s $* doc >/dev/null"
+ # rst2man returns 0 even in case of warnings/errors, so we check that
+ # stderr is empty.
+ make $J -s $* doc |& tee /dev/stderr | [ $(wc -l) -eq 0 ] || false
+ if [ $? -ne 0 ] ; then
+ ERROR=1
+ printf "FAILURE: Errors or warnings when building documentation\n"
+ fi
+ (
+ if [ $# -ge 1 ] ; then
+ cd ${@: -1}
+ fi
+ make -s doc-clean
+ )
+ echo
+}
+
echo "Trying to build bpftool"
echo -e "... through kbuild\n"
@@ -145,3 +164,7 @@ make_and_clean
make_with_tmpdir OUTPUT
make_with_tmpdir O
+
+echo -e "Checking documentation build\n"
+# From tools/bpf/bpftool
+make_doc_and_clean
eBPF selftests include a script to check that bpftool builds correctly with different command lines. Let's add one build for bpftool's documentation so as to detect errors or warning reported by rst2man when compiling the man pages. This also builds and checks warnings for the man page for eBPF helpers, which is built along bpftool's documentation. Signed-off-by: Quentin Monnet <quentin@isovalent.com> --- .../selftests/bpf/test_bpftool_build.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+)