Skip to content

Commit 0a85fa1

Browse files
qmonnettsipa
authored andcommitted
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 <[email protected]> --- .../selftests/bpf/test_bpftool_build.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+)
1 parent bfe8506 commit 0a85fa1

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tools/testing/selftests/bpf/test_bpftool_build.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@ make_with_tmpdir() {
8585
echo
8686
}
8787

88+
make_doc_and_clean() {
89+
echo -e "\$PWD: $PWD"
90+
echo -e "command: make -s $* doc >/dev/null"
91+
# rst2man returns 0 even in case of warnings/errors, so we check that
92+
# stderr is empty.
93+
make $J -s $* doc |& tee /dev/stderr | [ $(wc -l) -eq 0 ] || false
94+
if [ $? -ne 0 ] ; then
95+
ERROR=1
96+
printf "FAILURE: Errors or warnings when building documentation\n"
97+
fi
98+
(
99+
if [ $# -ge 1 ] ; then
100+
cd ${@: -1}
101+
fi
102+
make -s doc-clean
103+
)
104+
echo
105+
}
106+
88107
echo "Trying to build bpftool"
89108
echo -e "... through kbuild\n"
90109

@@ -145,3 +164,7 @@ make_and_clean
145164
make_with_tmpdir OUTPUT
146165

147166
make_with_tmpdir O
167+
168+
echo -e "Checking documentation build\n"
169+
# From tools/bpf/bpftool
170+
make_doc_and_clean

0 commit comments

Comments
 (0)