2021-03-03 01:19:43 +08:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
2021-06-08 09:57:56 +08:00
|
|
|
set -e
|
2021-03-03 01:19:43 +08:00
|
|
|
|
|
|
|
# Assume script is located under tools/testing/selftests/bpf/. We want to start
|
|
|
|
# build attempts from the top of kernel repository.
|
2021-08-20 09:55:54 +08:00
|
|
|
SCRIPT_REL_PATH=$(realpath $0)
|
2021-03-03 01:19:43 +08:00
|
|
|
SCRIPT_REL_DIR=$(dirname $SCRIPT_REL_PATH)
|
2021-08-20 09:55:54 +08:00
|
|
|
KDIR_ROOT_DIR=$(realpath $SCRIPT_REL_DIR/../../../../)
|
|
|
|
SCRIPT_REL_DIR=$(dirname $(realpath --relative-to=$KDIR_ROOT_DIR $SCRIPT_REL_PATH))
|
2021-03-03 01:19:43 +08:00
|
|
|
cd $KDIR_ROOT_DIR
|
|
|
|
|
selftests/bpf: Exit with KSFT_SKIP if no Makefile found
This would happend when we run the tests after install kselftests
root@lkp-skl-d01 ~# /kselftests/run_kselftest.sh -t bpf:test_doc_build.sh
TAP version 13
1..1
# selftests: bpf: test_doc_build.sh
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_ADDRESS = "en_US.UTF-8",
LC_NAME = "en_US.UTF-8",
LC_MONETARY = "en_US.UTF-8",
LC_PAPER = "en_US.UTF-8",
LC_IDENTIFICATION = "en_US.UTF-8",
LC_TELEPHONE = "en_US.UTF-8",
LC_MEASUREMENT = "en_US.UTF-8",
LC_TIME = "en_US.UTF-8",
LC_NUMERIC = "en_US.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
# skip: bpftool files not found!
#
ok 1 selftests: bpf: test_doc_build.sh # SKIP
Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210820025549.28325-1-lizhijian@cn.fujitsu.com
2021-08-20 10:55:49 +08:00
|
|
|
if [ ! -e $PWD/$SCRIPT_REL_DIR/Makefile ]; then
|
|
|
|
echo -e "skip: bpftool files not found!\n"
|
|
|
|
exit 4 # KSFT_SKIP=4
|
|
|
|
fi
|
|
|
|
|
2021-03-03 01:19:43 +08:00
|
|
|
for tgt in docs docs-clean; do
|
|
|
|
make -s -C $PWD/$SCRIPT_REL_DIR $tgt;
|
|
|
|
done
|