2020-02-12 20:20:53 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-08-22 02:06:43 +00:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
source $(cd $(dirname $0) && pwd)/helpers.sh
|
|
|
|
|
|
|
|
travis_fold start prepare_selftests "Building selftests"
|
2020-06-02 00:35:31 +00:00
|
|
|
|
2021-02-03 18:23:48 +00:00
|
|
|
sudo apt-get -y install python-docutils # for rst2man
|
|
|
|
|
2021-08-03 19:29:16 +00:00
|
|
|
LLVM_VER=14
|
2020-02-12 20:20:53 +00:00
|
|
|
LIBBPF_PATH="${REPO_ROOT}"
|
2020-02-21 23:11:54 +00:00
|
|
|
|
2020-06-02 00:35:31 +00:00
|
|
|
PREPARE_SELFTESTS_SCRIPT=${VMTEST_ROOT}/prepare_selftests-${KERNEL}.sh
|
|
|
|
if [ -f "${PREPARE_SELFTESTS_SCRIPT}" ]; then
|
|
|
|
(cd "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" && ${PREPARE_SELFTESTS_SCRIPT})
|
|
|
|
fi
|
2020-02-21 23:11:54 +00:00
|
|
|
|
2020-06-30 23:28:20 +00:00
|
|
|
if [[ "${KERNEL}" = 'LATEST' ]]; then
|
|
|
|
VMLINUX_H=
|
|
|
|
else
|
|
|
|
VMLINUX_H=${VMTEST_ROOT}/vmlinux.h
|
|
|
|
fi
|
|
|
|
|
2020-02-12 20:20:53 +00:00
|
|
|
make \
|
2020-02-21 23:11:54 +00:00
|
|
|
CLANG=clang-${LLVM_VER} \
|
|
|
|
LLC=llc-${LLVM_VER} \
|
|
|
|
LLVM_STRIP=llvm-strip-${LLVM_VER} \
|
2020-02-12 20:20:53 +00:00
|
|
|
VMLINUX_BTF="${VMLINUX_BTF}" \
|
2020-06-30 23:28:20 +00:00
|
|
|
VMLINUX_H=${VMLINUX_H} \
|
2020-02-12 20:20:53 +00:00
|
|
|
-C "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
|
2021-08-05 01:32:14 +00:00
|
|
|
-j $((4*$(nproc))) >/dev/null
|
2020-02-12 20:20:53 +00:00
|
|
|
mkdir ${LIBBPF_PATH}/selftests
|
|
|
|
cp -R "${REPO_ROOT}/${REPO_PATH}/tools/testing/selftests/bpf" \
|
|
|
|
${LIBBPF_PATH}/selftests
|
|
|
|
cd ${LIBBPF_PATH}
|
|
|
|
rm selftests/bpf/.gitignore
|
|
|
|
git add selftests
|
|
|
|
|
2020-06-02 00:35:31 +00:00
|
|
|
git add "${VMTEST_ROOT}/configs/blacklist"
|
2020-08-22 02:06:43 +00:00
|
|
|
|
|
|
|
travis_fold end prepare_selftests
|