selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
#!/bin/bash
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
# Test runner for nolibc tests
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
trap 'echo Aborting...' 'ERR'
|
|
|
|
|
|
|
|
crosstool_version=13.2.0
|
|
|
|
hostarch=x86_64
|
|
|
|
nproc=$(( $(nproc) + 2))
|
|
|
|
cache_dir="${XDG_CACHE_HOME:-"$HOME"/.cache}"
|
|
|
|
download_location="${cache_dir}/crosstools/"
|
|
|
|
build_location="$(realpath "${cache_dir}"/nolibc-tests/)"
|
|
|
|
perform_download=0
|
2077-09-15 02:13:53 +02:00
|
|
|
test_mode=system
|
2024-08-07 23:51:48 +02:00
|
|
|
werror=1
|
2024-08-07 23:51:51 +02:00
|
|
|
llvm=
|
2025-02-11 12:03:52 +01:00
|
|
|
all_archs=(
|
2025-07-12 11:00:56 +02:00
|
|
|
i386 x86_64 x32
|
2025-03-01 12:24:00 +01:00
|
|
|
arm64 arm armthumb
|
2025-06-23 23:25:39 +02:00
|
|
|
mips32le mips32be mipsn32le mipsn32be mips64le mips64be
|
2025-02-11 12:03:52 +01:00
|
|
|
ppc ppc64 ppc64le
|
|
|
|
riscv32 riscv64
|
2025-02-06 08:10:27 +01:00
|
|
|
s390x s390
|
2025-02-11 12:03:52 +01:00
|
|
|
loongarch
|
2025-02-26 15:05:17 +01:00
|
|
|
sparc32 sparc64
|
2025-04-27 07:47:38 +09:00
|
|
|
m68k
|
2025-06-23 23:15:54 +02:00
|
|
|
sh4
|
2025-02-11 12:03:52 +01:00
|
|
|
)
|
|
|
|
archs="${all_archs[@]}"
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
|
2024-08-07 23:51:51 +02:00
|
|
|
TEMP=$(getopt -o 'j:d:c:b:a:m:pelh' -n "$0" -- "$@")
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
|
|
|
|
eval set -- "$TEMP"
|
|
|
|
unset TEMP
|
|
|
|
|
|
|
|
print_usage() {
|
|
|
|
cat <<EOF
|
|
|
|
Run nolibc testsuite for multiple architectures with crosstools
|
|
|
|
|
|
|
|
Usage:
|
|
|
|
$0 [options] <architectures>
|
|
|
|
|
|
|
|
Known architectures:
|
|
|
|
${archs}
|
|
|
|
|
|
|
|
Options:
|
|
|
|
-j [N] Allow N jobs at once (default: ${nproc})
|
|
|
|
-p Allow download of toolchains
|
|
|
|
-d [DIR] Download location for toolchains (default: ${download_location})
|
|
|
|
-c [VERSION] Version of toolchains to use (default: ${crosstool_version})
|
|
|
|
-a [ARCH] Host architecture of toolchains to use (default: ${hostarch})
|
|
|
|
-b [DIR] Build location (default: ${build_location})
|
2077-09-15 02:13:53 +02:00
|
|
|
-m [MODE] Test mode user/system (default: ${test_mode})
|
2024-04-23 18:26:06 +02:00
|
|
|
-e Disable -Werror
|
2024-08-07 23:51:51 +02:00
|
|
|
-l Build with LLVM/clang
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
while true; do
|
|
|
|
case "$1" in
|
|
|
|
'-j')
|
|
|
|
nproc="$2"
|
|
|
|
shift 2; continue ;;
|
|
|
|
'-p')
|
|
|
|
perform_download=1
|
|
|
|
shift; continue ;;
|
|
|
|
'-d')
|
|
|
|
download_location="$2"
|
|
|
|
shift 2; continue ;;
|
|
|
|
'-c')
|
|
|
|
crosstool_version="$2"
|
|
|
|
shift 2; continue ;;
|
|
|
|
'-a')
|
|
|
|
hostarch="$2"
|
|
|
|
shift 2; continue ;;
|
|
|
|
'-b')
|
|
|
|
build_location="$(realpath "$2")"
|
|
|
|
shift 2; continue ;;
|
2077-09-15 02:13:53 +02:00
|
|
|
'-m')
|
|
|
|
test_mode="$2"
|
|
|
|
shift 2; continue ;;
|
2024-04-23 18:26:06 +02:00
|
|
|
'-e')
|
2024-08-07 23:51:48 +02:00
|
|
|
werror=0
|
2024-04-23 18:26:06 +02:00
|
|
|
shift; continue ;;
|
2024-08-07 23:51:51 +02:00
|
|
|
'-l')
|
|
|
|
llvm=1
|
|
|
|
shift; continue ;;
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
'-h')
|
|
|
|
print_usage
|
|
|
|
exit 0
|
|
|
|
;;
|
|
|
|
'--')
|
|
|
|
shift; break ;;
|
|
|
|
*)
|
|
|
|
echo 'Internal error!' >&2; exit 1 ;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
if [[ -n "$*" ]]; then
|
|
|
|
archs="$*"
|
|
|
|
fi
|
|
|
|
|
|
|
|
crosstool_arch() {
|
|
|
|
case "$1" in
|
|
|
|
arm64) echo aarch64;;
|
2025-03-01 12:24:00 +01:00
|
|
|
armthumb) echo arm;;
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
ppc) echo powerpc;;
|
|
|
|
ppc64) echo powerpc64;;
|
|
|
|
ppc64le) echo powerpc64;;
|
|
|
|
riscv) echo riscv64;;
|
|
|
|
loongarch) echo loongarch64;;
|
|
|
|
mips*) echo mips;;
|
2025-02-06 08:10:26 +01:00
|
|
|
s390*) echo s390;;
|
2025-02-26 15:05:17 +01:00
|
|
|
sparc*) echo sparc64;;
|
2025-07-12 11:00:56 +02:00
|
|
|
x32*) echo x86_64;;
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
*) echo "$1";;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
crosstool_abi() {
|
|
|
|
case "$1" in
|
2025-03-01 12:24:00 +01:00
|
|
|
arm | armthumb) echo linux-gnueabi;;
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
*) echo linux;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
download_crosstool() {
|
|
|
|
arch="$(crosstool_arch "$1")"
|
|
|
|
abi="$(crosstool_abi "$1")"
|
|
|
|
|
|
|
|
archive_name="${hostarch}-gcc-${crosstool_version}-nolibc-${arch}-${abi}.tar.gz"
|
|
|
|
url="https://mirrors.edge.kernel.org/pub/tools/crosstool/files/bin/${hostarch}/${crosstool_version}/${archive_name}"
|
|
|
|
archive="${download_location}${archive_name}"
|
|
|
|
stamp="${archive}.stamp"
|
|
|
|
|
|
|
|
[ -f "${stamp}" ] && return
|
|
|
|
|
|
|
|
echo "Downloading crosstools ${arch} ${crosstool_version}"
|
|
|
|
mkdir -p "${download_location}"
|
|
|
|
curl -o "${archive}" --fail --continue-at - "${url}"
|
|
|
|
tar -C "${download_location}" -xf "${archive}"
|
|
|
|
touch "${stamp}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# capture command output, print it on failure
|
|
|
|
# mimics chronic(1) from moreutils
|
|
|
|
function swallow_output() {
|
|
|
|
if ! OUTPUT="$("$@" 2>&1)"; then
|
|
|
|
echo "$OUTPUT"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
test_arch() {
|
|
|
|
arch=$1
|
|
|
|
ct_arch=$(crosstool_arch "$arch")
|
|
|
|
ct_abi=$(crosstool_abi "$1")
|
2024-09-08 12:00:12 +02:00
|
|
|
|
|
|
|
if [ ! -d "${download_location}gcc-${crosstool_version}-nolibc/${ct_arch}-${ct_abi}/bin/." ]; then
|
|
|
|
echo "No toolchain found in ${download_location}gcc-${crosstool_version}-nolibc/${ct_arch}-${ct_abi}."
|
|
|
|
echo "Did you install the toolchains or set the correct arch ? Rerun with -h for help."
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
cross_compile=$(realpath "${download_location}gcc-${crosstool_version}-nolibc/${ct_arch}-${ct_abi}/bin/${ct_arch}-${ct_abi}-")
|
|
|
|
build_dir="${build_location}/${arch}"
|
2024-08-07 23:51:48 +02:00
|
|
|
if [ "$werror" -ne 0 ]; then
|
|
|
|
CFLAGS_EXTRA="$CFLAGS_EXTRA -Werror"
|
|
|
|
fi
|
2025-06-20 23:39:32 +02:00
|
|
|
MAKE=(make -f Makefile.nolibc -j"${nproc}" XARCH="${arch}" CROSS_COMPILE="${cross_compile}" LLVM="${llvm}" O="${build_dir}")
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
|
2077-09-15 02:13:53 +02:00
|
|
|
case "$test_mode" in
|
|
|
|
'system')
|
|
|
|
test_target=run
|
|
|
|
;;
|
|
|
|
'user')
|
|
|
|
test_target=run-user
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Unknown mode $test_mode"
|
|
|
|
exit 1
|
|
|
|
esac
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
printf '%-15s' "$arch:"
|
2025-02-06 08:10:27 +01:00
|
|
|
if [ "$arch" = "s390" ] && ([ "$llvm" = "1" ] || [ "$test_mode" = "user" ]); then
|
|
|
|
echo "Unsupported configuration"
|
|
|
|
return
|
|
|
|
fi
|
2025-06-23 23:15:54 +02:00
|
|
|
if [ "$arch" = "m68k" -o "$arch" = "sh4" ] && [ "$llvm" = "1" ]; then
|
2025-04-27 07:47:38 +09:00
|
|
|
echo "Unsupported configuration"
|
|
|
|
return
|
|
|
|
fi
|
2025-07-12 11:00:56 +02:00
|
|
|
if [ "$arch" = "x32" ] && [ "$test_mode" = "user" ]; then
|
|
|
|
echo "Unsupported configuration"
|
|
|
|
return
|
|
|
|
fi
|
2025-01-23 08:37:41 +01:00
|
|
|
|
|
|
|
mkdir -p "$build_dir"
|
|
|
|
swallow_output "${MAKE[@]}" defconfig
|
2024-04-23 18:26:06 +02:00
|
|
|
swallow_output "${MAKE[@]}" CFLAGS_EXTRA="$CFLAGS_EXTRA" "$test_target" V=1
|
selftests/nolibc: add script to run testsuite
The script can run the testsuite for multiple architectures and provides
an overall test report.
Furthermore it can automatically download crosstools from
mirrors.kernel.org if requested by the user.
Example execution:
$ ./run-tests.sh
i386: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
x86_64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
arm: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
mips: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
ppc: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
ppc64le: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
riscv: 162 test(s): 162 passed, 0 skipped, 0 failed => status: success
s390: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
loongarch: 162 test(s): 161 passed, 1 skipped, 0 failed => status: warning
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://lore.kernel.org/r/20231105-nolibc-run-tests-v1-1-b59ff770a978@weissschuh.net
2023-11-05 10:23:05 +01:00
|
|
|
cp run.out run.out."${arch}"
|
|
|
|
"${MAKE[@]}" report | grep passed
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$perform_download" -ne 0 ]; then
|
|
|
|
for arch in $archs; do
|
|
|
|
download_crosstool "$arch"
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
|
|
|
|
for arch in $archs; do
|
|
|
|
test_arch "$arch"
|
|
|
|
done
|