utils/test-pkg: add new option -T/--toolchain-name
Recently when trying to reproduce a build error with test-pkg on the toolchain
br-arm-basic, I had to create a new CSV file with that toolchain only to be
able to run the test in that single case.
I believe having a command-line option right away in test-pkg would make this
much easier, as I can now run: `./utils/test-pkg -T br-arm-basic -p redis`
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Arnout Vandecappelle <arnout@rnout.be>
(cherry picked from commit f3be464f7a)
Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
This commit is contained in:
@@ -22,8 +22,8 @@ main() {
|
|||||||
local -a toolchains
|
local -a toolchains
|
||||||
local pkg_br_name
|
local pkg_br_name
|
||||||
|
|
||||||
o='hakc:d:n:p:r:t:'
|
o='hakc:d:n:p:r:t:T:'
|
||||||
O='help,all,keep,prepare-only,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:'
|
O='help,all,keep,prepare-only,config-snippet:,build-dir:,number:,package:,random:,toolchains-csv:,toolchain-name:'
|
||||||
opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")"
|
opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")"
|
||||||
eval set -- "${opts}"
|
eval set -- "${opts}"
|
||||||
|
|
||||||
@@ -66,6 +66,9 @@ main() {
|
|||||||
(-t|--toolchains-csv)
|
(-t|--toolchains-csv)
|
||||||
toolchains_csv="${2}"; shift 2
|
toolchains_csv="${2}"; shift 2
|
||||||
;;
|
;;
|
||||||
|
(-T|--toolchain-name)
|
||||||
|
toolchain_name="${2}"; shift 2
|
||||||
|
;;
|
||||||
(--)
|
(--)
|
||||||
shift; break
|
shift; break
|
||||||
;;
|
;;
|
||||||
@@ -113,7 +116,9 @@ main() {
|
|||||||
# E.g.: http://server/path/to/name.config,arch,libc
|
# E.g.: http://server/path/to/name.config,arch,libc
|
||||||
# --> http://server/path/to/name.config
|
# --> http://server/path/to/name.config
|
||||||
mapfile -t toolchains < <(sed -r -e 's/,.*//; /internal/d; /^#/d; /^$/d;' "${toolchains_csv}" \
|
mapfile -t toolchains < <(sed -r -e 's/,.*//; /internal/d; /^#/d; /^$/d;' "${toolchains_csv}" \
|
||||||
| if [ "${random}" -gt 0 ]; then \
|
| if [ -n "${toolchain_name}" ]; then \
|
||||||
|
grep -E "[/^]${toolchain_name}.config"
|
||||||
|
elif [ "${random}" -gt 0 ]; then \
|
||||||
sort -R | head -n "${random}"
|
sort -R | head -n "${random}"
|
||||||
elif [ "${number}" -gt 0 ]; then \
|
elif [ "${number}" -gt 0 ]; then \
|
||||||
head -n "${number}"
|
head -n "${number}"
|
||||||
@@ -288,6 +293,12 @@ Options:
|
|||||||
try. If not specified, the toolchains in ${TOOLCHAINS_CSV} will be
|
try. If not specified, the toolchains in ${TOOLCHAINS_CSV} will be
|
||||||
used.
|
used.
|
||||||
|
|
||||||
|
-T NAME, --toolchain-name NAME
|
||||||
|
Name of the single toolchain to use. It must be defined in the CSV
|
||||||
|
list of toolchains (see also -t / --toolchains-csv). If this option
|
||||||
|
is specified, then a single build will be performed on that
|
||||||
|
specific toolchain only.
|
||||||
|
|
||||||
-k, --keep
|
-k, --keep
|
||||||
Keep the build directories even if the build succeeds.
|
Keep the build directories even if the build succeeds.
|
||||||
Note: the logfile and configuration is always retained, even without
|
Note: the logfile and configuration is always retained, even without
|
||||||
|
|||||||
Reference in New Issue
Block a user