summaryrefslogtreecommitdiff
path: root/support
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2017-02-08 21:15:27 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2017-02-09 23:12:36 +0100
commit9e7885d5f76f8068fa566344ba17721d049c42de (patch)
treeffca2a7130b6e1300c5acff7f1a152161fb931a2 /support
parentd5c58ceec2aad7415bfb8d4cee1d98779535b615 (diff)
support/test-pkg: add option to limit the number of tests
Sometimes, it interesting to have a global overview of whether the package builds at all or not, rather than test on all toolchains. Add an option that allows testing on a limited set of randomly choosen toolchains. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Luca Ceresoli <luca@lucaceresoli.net> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support')
-rwxr-xr-xsupport/scripts/test-pkg21
1 files changed, 17 insertions, 4 deletions
diff --git a/support/scripts/test-pkg b/support/scripts/test-pkg
index 5eeaf63db..b867da8bb 100755
--- a/support/scripts/test-pkg
+++ b/support/scripts/test-pkg
@@ -5,14 +5,15 @@ TOOLCHAINS_URL='http://autobuild.buildroot.org/toolchains/configs/toolchain-conf
main() {
local o O opts
- local cfg dir pkg toolchain
+ local cfg dir pkg random toolchain
local -a toolchains
- o='hc:d:p:'
- O='help,config-snippet:build-dir:package:'
+ o='hc:d:p:r:'
+ O='help,config-snippet:build-dir:package:,random:'
opts="$( getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}" )"
eval set -- "${opts}"
+ random=0
while [ ${#} -gt 0 ]; do
case "${1}" in
(-h|--help)
@@ -27,6 +28,9 @@ main() {
(-p|--package)
pkg="${2}"; shift 2
;;
+ (-r|--random)
+ random="${2}"; shift 2
+ ;;
(--)
shift; break
;;
@@ -43,7 +47,12 @@ main() {
# E.g.: http://server/path/to/name.config,arch,libc
# --> http://server/path/to/name.config
toolchains=( $( curl -s "${TOOLCHAINS_URL}" \
- |sed -r -e 's/,.*//; /internal/d;'
+ |sed -r -e 's/,.*//; /internal/d;' \
+ |if [ ${random} -gt 0 ]; then \
+ sort -R |head -n ${random}
+ else
+ cat
+ fi |sort
)
)
@@ -159,6 +168,10 @@ Options:
Test-build the package PKG, by running 'make PKG'; if not specified,
just runs 'make'.
+ -r N, --random N
+ Limit the tests to the N randomly selected toolchains, instead of
+ building with all toolchains.
+
Example:
Testing libcec would require a config snippet that contains: