----
$ ./support/scripts/test-pkg -c libcurl.config -p libcurl
- armv5-ctng-linux-gnueabi: OK
- armv7-ctng-linux-gnueabihf: OK
- br-aarch64-glibc: SKIPPED
- br-arcle-hs38: SKIPPED
- br-arm-basic: FAILED
- br-arm-cortex-a9-glibc: OK
- br-arm-cortex-a9-musl: FAILED
- br-arm-cortex-m4-full: OK
- br-arm-full: OK
- br-arm-full-nothread: OK
- br-arm-full-static: OK
+ armv5-ctng-linux-gnueabi [ 1/11]: OK
+ armv7-ctng-linux-gnueabihf [ 2/11]: OK
+ br-aarch64-glibc [ 3/11]: SKIPPED
+ br-arcle-hs38 [ 4/11]: SKIPPED
+ br-arm-basic [ 5/11]: FAILED
+ br-arm-cortex-a9-glibc [ 6/11]: OK
+ br-arm-cortex-a9-musl [ 7/11]: FAILED
+ br-arm-cortex-m4-full [ 8/11]: OK
+ br-arm-full [ 9/11]: OK
+ br-arm-full-nothread [10/11]: OK
+ br-arm-full-static [11/11]: OK
11 builds, 2 skipped, 2 failed
----
main() {
local o O opts
local cfg dir pkg random toolchain
- local ret nb nb_skip nb_fail
+ local ret nb nb_skip nb_fail nb_tc
local -a toolchains
o='hc:d:p:r:'
)
)
- if [ ${#toolchains[@]} -eq 0 ]; then
+ nb_tc="${#toolchains[@]}"
+ if [ ${nb_tc} -eq 0 ]; then
printf "error: no toolchain found (networking issue?)\n" >&2; exit 1
fi
nb_skip=0
nb_fail=0
for toolchain in "${toolchains[@]}"; do
+ : $((nb++))
+ printf "%40s [%*d/%d]: " "$(basename "${toolchain}" .config)" \
+ ${#nb_tc} ${nb} ${nb_tc}
build_one "${dir}" "${toolchain}" "${cfg}" "${pkg}" && ret=0 || ret=${?}
case ${ret} in
- (0) ;;
- (1) : $((nb_skip++));;
- (2) : $((nb_fail++));;
+ (0) printf "OK\n";;
+ (1) : $((nb_skip++)); printf "SKIPPED\n";;
+ (2) : $((nb_fail++)); printf "FAILED\n";;
esac
- : $((nb++))
done
printf "%d builds, %d skipped, %d failed\n" ${nb} ${nb_skip} ${nb_fail}
# Using basename(1) on a URL works nicely
toolchain="$(basename "${url}" .config)"
- printf "%40s: " "${toolchain}"
-
dir="${dir}/${toolchain}"
mkdir -p "${dir}"
if ! curl -s "${url}" >"${dir}/.config"; then
- printf "FAILED\n"
return 2
fi
cat "${cfg}" >>"${dir}/.config"
if ! make O="${dir}" olddefconfig > "${dir}/logfile" 2>&1; then
- printf "FAILED\n"
return 2
fi
# We want all the options from the snippet to be present as-is (set
# done in the same locale.
comm -23 <(sort "${cfg}") <(sort "${dir}/.config") >"${dir}/missing.config"
if [ -s "${dir}/missing.config" ]; then
- printf "SKIPPED\n"
return 1
fi
# Remove file, it's empty anyway.
if [ -n "${pkg}" ]; then
if ! make O="${dir}" "${pkg}-dirclean" >> "${dir}/logfile" 2>&1; then
- printf "FAILED\n"
return 2
fi
fi
# shellcheck disable=SC2086
if ! make O="${dir}" ${pkg} >> "${dir}/logfile" 2>&1; then
- printf "FAILED\n"
return 2
fi
-
- printf "OK\n"
}
help() {