Skip to content

Commit

Permalink
eBPF selftests include a script to check that bpftool builds correctly
Browse files Browse the repository at this point in the history
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(+)
  • Loading branch information
qmonnet authored and kernel-patches-bot committed Sep 9, 2020
1 parent 5b7e803 commit 205ed11
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tools/testing/selftests/bpf/test_bpftool_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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

0 comments on commit 205ed11

Please sign in to comment.