2017-06-05 09:37:40 +02:00
|
|
|
#!/usr/bin/env bash
|
2017-02-08 21:15:24 +01:00
|
|
|
set -e
|
|
|
|
|
2017-07-21 03:05:24 +02:00
|
|
|
TOOLCHAINS_CSV='support/config-fragments/autobuild/toolchain-configs.csv'
|
2019-03-01 13:33:42 +01:00
|
|
|
TEMP_CONF=""
|
|
|
|
|
|
|
|
do_clean() {
|
|
|
|
if [ ! -z "${TEMP_CONF}" ]; then
|
|
|
|
rm -f "${TEMP_CONF}"
|
|
|
|
fi
|
|
|
|
}
|
2017-02-08 21:15:24 +01:00
|
|
|
|
|
|
|
main() {
|
|
|
|
local o O opts
|
2019-02-05 22:21:41 +01:00
|
|
|
local cfg dir pkg random toolchains_csv toolchain all number mode
|
2019-02-05 22:21:42 +01:00
|
|
|
local ret nb nb_skip nb_fail nb_legal nb_tc build_dir keep
|
2017-02-08 21:15:24 +01:00
|
|
|
local -a toolchains
|
2019-03-01 13:33:42 +01:00
|
|
|
local pkg_br_name
|
2017-02-08 21:15:24 +01:00
|
|
|
|
2019-02-05 22:21:42 +01:00
|
|
|
o='hakc:d:n:p:r:t:'
|
|
|
|
O='help,all,keep,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:'
|
2017-02-12 15:53:05 +01:00
|
|
|
opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")"
|
2017-02-08 21:15:24 +01:00
|
|
|
eval set -- "${opts}"
|
|
|
|
|
2017-02-08 21:15:27 +01:00
|
|
|
random=0
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
all=0
|
2019-02-05 22:21:42 +01:00
|
|
|
keep=0
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
number=0
|
|
|
|
mode=0
|
2017-07-25 23:36:12 +02:00
|
|
|
toolchains_csv="${TOOLCHAINS_CSV}"
|
2017-02-08 21:15:24 +01:00
|
|
|
while [ ${#} -gt 0 ]; do
|
|
|
|
case "${1}" in
|
|
|
|
(-h|--help)
|
|
|
|
help; exit 0
|
|
|
|
;;
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
(-a|--all)
|
|
|
|
all=1; shift 1
|
|
|
|
;;
|
2019-02-05 22:21:42 +01:00
|
|
|
(-k|--keep)
|
|
|
|
keep=1; shift 1
|
|
|
|
;;
|
2017-02-08 21:15:24 +01:00
|
|
|
(-c|--config-snippet)
|
|
|
|
cfg="${2}"; shift 2
|
|
|
|
;;
|
|
|
|
(-d|--build-dir)
|
|
|
|
dir="${2}"; shift 2
|
|
|
|
;;
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
(-n|--number)
|
|
|
|
number="${2}"; shift 2
|
|
|
|
;;
|
2017-02-08 21:15:24 +01:00
|
|
|
(-p|--package)
|
|
|
|
pkg="${2}"; shift 2
|
|
|
|
;;
|
2017-02-08 21:15:27 +01:00
|
|
|
(-r|--random)
|
|
|
|
random="${2}"; shift 2
|
|
|
|
;;
|
2017-07-25 23:36:12 +02:00
|
|
|
(-t|--toolchains-csv)
|
|
|
|
toolchains_csv="${2}"; shift 2
|
|
|
|
;;
|
2017-02-08 21:15:24 +01:00
|
|
|
(--)
|
|
|
|
shift; break
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
2019-03-01 13:33:42 +01:00
|
|
|
|
|
|
|
trap do_clean INT TERM HUP EXIT
|
|
|
|
|
2017-02-08 21:15:24 +01:00
|
|
|
if [ -z "${cfg}" ]; then
|
2019-03-01 13:33:42 +01:00
|
|
|
pkg_br_name="${pkg//-/_}"
|
|
|
|
pkg_br_name="BR2_PACKAGE_${pkg_br_name^^}"
|
|
|
|
TEMP_CONF=$(mktemp /tmp/test-${pkg}-config.XXXXXX)
|
|
|
|
echo "${pkg_br_name}=y" > ${TEMP_CONF}
|
|
|
|
cfg="${TEMP_CONF}"
|
2017-02-08 21:15:24 +01:00
|
|
|
fi
|
2017-02-12 15:53:06 +01:00
|
|
|
if [ ! -e "${cfg}" ]; then
|
|
|
|
printf "error: %s: no such file\n" "${cfg}" >&2; exit 1
|
|
|
|
fi
|
2017-02-08 21:15:24 +01:00
|
|
|
if [ -z "${dir}" ]; then
|
|
|
|
dir="${HOME}/br-test-pkg"
|
|
|
|
fi
|
|
|
|
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
if [ ${random} -gt 0 ]; then
|
|
|
|
mode=$((mode+1))
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ${number} -gt 0 ]; then
|
|
|
|
mode=$((mode+1))
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ${all} -eq 1 ]; then
|
|
|
|
mode=$((mode+1))
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Default mode is to test the N first toolchains, which have been
|
|
|
|
# chosen to be a good selection of toolchains.
|
|
|
|
if [ ${mode} -eq 0 ] ; then
|
2018-04-05 21:50:15 +02:00
|
|
|
number=6
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
elif [ ${mode} -gt 1 ] ; then
|
|
|
|
printf "error: --all, --number and --random are mutually exclusive\n" >&2; exit 1
|
|
|
|
fi
|
|
|
|
|
2017-02-08 21:15:24 +01:00
|
|
|
# Extract the URLs of the toolchains; drop internal toolchains
|
|
|
|
# E.g.: http://server/path/to/name.config,arch,libc
|
|
|
|
# --> http://server/path/to/name.config
|
2017-10-29 18:14:37 +01:00
|
|
|
toolchains=($(sed -r -e 's/,.*//; /internal/d; /^#/d; /^$/d;' "${toolchains_csv}" \
|
2017-02-12 15:53:05 +01:00
|
|
|
|if [ ${random} -gt 0 ]; then \
|
|
|
|
sort -R |head -n ${random}
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
elif [ ${number} -gt 0 ]; then \
|
|
|
|
head -n ${number}
|
|
|
|
else
|
|
|
|
sort
|
|
|
|
fi
|
2017-02-12 15:53:05 +01:00
|
|
|
)
|
2017-02-08 21:15:24 +01:00
|
|
|
)
|
|
|
|
|
2017-04-06 20:18:42 +02:00
|
|
|
nb_tc="${#toolchains[@]}"
|
|
|
|
if [ ${nb_tc} -eq 0 ]; then
|
2017-02-08 21:15:24 +01:00
|
|
|
printf "error: no toolchain found (networking issue?)\n" >&2; exit 1
|
|
|
|
fi
|
|
|
|
|
2017-02-12 15:53:09 +01:00
|
|
|
nb=0
|
|
|
|
nb_skip=0
|
|
|
|
nb_fail=0
|
2017-04-07 13:16:17 +02:00
|
|
|
nb_legal=0
|
2017-04-07 13:16:16 +02:00
|
|
|
for toolchainconfig in "${toolchains[@]}"; do
|
2017-04-06 20:18:42 +02:00
|
|
|
: $((nb++))
|
2017-04-07 13:16:16 +02:00
|
|
|
toolchain="$(basename "${toolchainconfig}" .config)"
|
|
|
|
build_dir="${dir}/${toolchain}"
|
|
|
|
printf "%40s [%*d/%d]: " "${toolchain}" ${#nb_tc} ${nb} ${nb_tc}
|
|
|
|
build_one "${build_dir}" "${toolchainconfig}" "${cfg}" "${pkg}" && ret=0 || ret=${?}
|
2017-02-12 15:53:09 +01:00
|
|
|
case ${ret} in
|
2017-04-06 20:18:42 +02:00
|
|
|
(0) printf "OK\n";;
|
|
|
|
(1) : $((nb_skip++)); printf "SKIPPED\n";;
|
|
|
|
(2) : $((nb_fail++)); printf "FAILED\n";;
|
2017-04-07 13:16:17 +02:00
|
|
|
(3) : $((nb_legal++)); printf "FAILED\n";;
|
2017-02-12 15:53:09 +01:00
|
|
|
esac
|
2017-02-08 21:15:24 +01:00
|
|
|
done
|
2017-02-12 15:53:09 +01:00
|
|
|
|
2017-04-07 13:16:17 +02:00
|
|
|
printf "%d builds, %d skipped, %d build failed, %d legal-info failed\n" \
|
|
|
|
${nb} ${nb_skip} ${nb_fail} ${nb_legal}
|
2019-10-10 12:24:26 +02:00
|
|
|
|
|
|
|
return $((nb_fail + nb_legal))
|
2017-02-08 21:15:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
build_one() {
|
|
|
|
local dir="${1}"
|
2017-07-21 03:05:24 +02:00
|
|
|
local toolchainconfig="${2}"
|
2017-02-08 21:15:24 +01:00
|
|
|
local cfg="${3}"
|
|
|
|
local pkg="${4}"
|
|
|
|
|
|
|
|
mkdir -p "${dir}"
|
|
|
|
|
2018-11-14 08:46:05 +01:00
|
|
|
CONFIG_= support/kconfig/merge_config.sh -O "${dir}" \
|
2017-07-21 03:05:30 +02:00
|
|
|
"${toolchainconfig}" "support/config-fragments/minimal.config" "${cfg}" \
|
2018-07-08 12:26:59 +02:00
|
|
|
>> "${dir}/logfile" 2>&1
|
2017-02-08 21:15:24 +01:00
|
|
|
# We want all the options from the snippet to be present as-is (set
|
|
|
|
# or not set) in the actual .config; if one of them is not, it means
|
|
|
|
# some dependency from the toolchain or arch is not available, in
|
|
|
|
# which case this config is untestable and we skip it.
|
2017-02-12 15:53:07 +01:00
|
|
|
# We don't care about the locale to sort in, as long as both sort are
|
|
|
|
# done in the same locale.
|
|
|
|
comm -23 <(sort "${cfg}") <(sort "${dir}/.config") >"${dir}/missing.config"
|
|
|
|
if [ -s "${dir}/missing.config" ]; then
|
2017-02-12 15:53:09 +01:00
|
|
|
return 1
|
2017-02-08 21:15:25 +01:00
|
|
|
fi
|
|
|
|
# Remove file, it's empty anyway.
|
|
|
|
rm -f "${dir}/missing.config"
|
2017-02-08 21:15:24 +01:00
|
|
|
|
|
|
|
if [ -n "${pkg}" ]; then
|
|
|
|
if ! make O="${dir}" "${pkg}-dirclean" >> "${dir}/logfile" 2>&1; then
|
2017-02-12 15:53:09 +01:00
|
|
|
return 2
|
2017-02-08 21:15:24 +01:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
# shellcheck disable=SC2086
|
2019-01-02 16:49:20 +01:00
|
|
|
if ! BR_FORCE_CHECK_DEPENDENCIES=YES make O="${dir}" ${pkg} >> "${dir}/logfile" 2>&1; then
|
2017-02-12 15:53:09 +01:00
|
|
|
return 2
|
2017-02-08 21:15:24 +01:00
|
|
|
fi
|
2017-04-07 13:16:17 +02:00
|
|
|
|
|
|
|
# legal-info done systematically, because some packages have different
|
|
|
|
# sources depending on the configuration (e.g. lua-5.2 vs. lua-5.3)
|
2018-01-07 23:50:05 +01:00
|
|
|
if ! make O="${dir}" legal-info >> "${dir}/logfile" 2>&1; then
|
|
|
|
return 3
|
2017-04-07 13:16:17 +02:00
|
|
|
fi
|
2019-02-05 22:21:42 +01:00
|
|
|
|
|
|
|
# If we get here, the build was successful. Clean up the build/host
|
|
|
|
# directories to save disk space, unless 'keep' was set.
|
|
|
|
if [ ${keep} -ne 1 ]; then
|
|
|
|
make O="${dir}" clean >> "${dir}/logfile" 2>&1
|
|
|
|
fi
|
2017-02-08 21:15:24 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
help() {
|
|
|
|
cat <<_EOF_
|
|
|
|
test-pkg: test-build a package against various toolchains and architectures
|
|
|
|
|
|
|
|
The supplied config snippet is appended to each toolchain config, the
|
|
|
|
resulting configuration is checked to ensure it still contains all options
|
|
|
|
specified in the snippet; if any is missing, the build is skipped, on the
|
|
|
|
assumption that the package under test requires a toolchain or architecture
|
|
|
|
feature that is missing.
|
|
|
|
|
|
|
|
In case failures are noticed, you can fix the package and just re-run the
|
|
|
|
same command again; it will re-run the test where it failed. If you did
|
|
|
|
specify a package (with -p), the package build dir will be removed first.
|
|
|
|
|
2017-07-25 23:36:12 +02:00
|
|
|
The list of toolchains is retrieved from ${TOOLCHAINS_CSV}.
|
|
|
|
Only the external toolchains are tried, because building a Buildroot toolchain
|
|
|
|
would take too long. An alternative toolchains CSV file can be specified with
|
|
|
|
the -t option. This file should have lines consisting of the path to the
|
|
|
|
toolchain config fragment and the required host architecture, separated by a
|
|
|
|
comma. The config fragments should contain only the toolchain and architecture
|
|
|
|
settings.
|
2017-02-08 21:15:24 +01:00
|
|
|
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
By default, a useful subset of toolchains is tested. If needed, all
|
|
|
|
toolchains can be tested (-a), an arbitrary number of toolchains (-n
|
|
|
|
in order, -r for random).
|
|
|
|
|
2017-02-08 21:15:24 +01:00
|
|
|
Options:
|
|
|
|
|
|
|
|
-h, --help
|
|
|
|
Print this help.
|
|
|
|
|
|
|
|
-c CFG, --config-snippet CFG
|
|
|
|
Use the CFG file as the source for the config snippet. This file
|
|
|
|
should contain all the config options required to build a package.
|
|
|
|
|
|
|
|
-d DIR, --build-dir DIR
|
|
|
|
Do the builds in directory DIR, one sub-dir per toolchain.
|
|
|
|
|
|
|
|
-p PKG, --package PKG
|
|
|
|
Test-build the package PKG, by running 'make PKG'; if not specified,
|
|
|
|
just runs 'make'.
|
|
|
|
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
-a, --all
|
|
|
|
Test all toolchains, instead of the default subset defined by
|
|
|
|
Buildroot developers.
|
|
|
|
|
|
|
|
-n N, --number N
|
|
|
|
Test N toolchains, in the order defined in the toolchain CSV
|
|
|
|
file.
|
|
|
|
|
2017-02-08 21:15:27 +01:00
|
|
|
-r N, --random N
|
test-pkg: test a subset of toolchains by default, add -a and -n options
During the latest Buildroot Developers meeting, we discussed that
test-pkg would perhaps be more widely used if it tested a smaller
subset of toolchains. Indeed, it currently tests 47 toolchains, which
takes very long to build. Several of the toolchain configurations are
quite similar, and it is perhaps not necessary for contributors to
test them all before submitting a package.
Therefore, this commit changes the test-pkg script to only test a
subset of the toolchain configurations by default. The N first
configurations of the CSV files are tested, where N is hard-coded in
the script. The CSV file has therefore been re-organized to have the
first N toolchains be the most important ones.
A -a/--all option is added to test with all toolchains, while a
-n/--number option is added to test with the first N toolchains, N
being passed on the command line.
Note that the list of toolchains (built in the "toolchains" shell
variable) is no longer sorted. Indeed, when the first N toolchains are
tested, we want them to be tested in the same order as they are listed
in the CSV file, as we are careful to order them in an interesting
order. We only sort when all toolchains are tested.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tested-by: Matt Weber <matthew.weber@rockwellcollins.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2018-03-23 22:48:14 +01:00
|
|
|
Limit the tests to the N randomly selected toolchains.
|
2017-02-08 21:15:27 +01:00
|
|
|
|
2017-07-25 23:36:12 +02:00
|
|
|
-t CSVFILE, --toolchains-csv CSVFILE
|
|
|
|
CSV file containing the paths to config fragments of toolchains to
|
|
|
|
try. If not specified, the toolchains in ${TOOLCHAINS_CSV} will be
|
|
|
|
used.
|
|
|
|
|
2019-02-05 22:21:42 +01:00
|
|
|
-k, --keep
|
|
|
|
Keep the build directories even if the build succeeds.
|
|
|
|
Note: the logfile and configuration is always retained, even without
|
|
|
|
this option.
|
|
|
|
|
2017-02-08 21:15:24 +01:00
|
|
|
Example:
|
|
|
|
|
|
|
|
Testing libcec would require a config snippet that contains:
|
|
|
|
BR2_PACKAGE_LIBCEC=y
|
|
|
|
|
|
|
|
Testing libcurl with openSSL support would require a snippet such as:
|
|
|
|
BR2_PACKAGE_OPENSSL=y
|
|
|
|
BR2_PACKAGE_LIBCURL=y
|
|
|
|
|
|
|
|
_EOF_
|
|
|
|
}
|
|
|
|
|
|
|
|
my_name="${0##*/}"
|
|
|
|
main "${@}"
|