Skip to contentSkip to conversation

utils/test-pkg: add option to use an alternate toolchains CSV file

PATCH New Arnout Vandecappelle (Essensium/Mind) 2 participants 3 messages Jul 25, 2017 – Jul 29, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 utils/test-pkg: add option to use an alternate toolchains CSV file

When testing a package with test-pkg, it may be useful to override the set of toolchains used. For example:
- to test with toolchains used in your company;
- to test agains a subset that is known to be problematic;
- to use only toolchains you already have available locally when you have no network access.

Add an option to use an alternate CSV file containing the config fragments of toolchains to try.

---
v8: reformulate commit message
v7: CSV file instead of directory
v6: s/defconfig/config fragment/g
v5: First version

Loosely based on http://patchwork.ozlabs.org/patch/728395/ but with a CSV file instead of URL, and completely rewritten help text.

---
 utils/test-pkg | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)
utils/test-pkg +20 -6
index f951eda563..6899d44f7c 100755
@@ -5,16 +5,17 @@ TOOLCHAINS_CSV='support/config-fragments/autobuild/toolchain-configs.csv'
 
 main() {
     local o O opts
-    local cfg dir pkg random toolchain
+    local cfg dir pkg random toolchains_dir toolchain
     local ret nb nb_skip nb_fail nb_legal nb_tc build_dir
     local -a toolchains
 
-    o='hc:d:p:r:'
-    O='help,config-snippet:build-dir:package:,random:'
+    o='hc:d:p:r:t:'
+    O='help,config-snippet:build-dir:package:,random:,toolchains-dir:'
     opts="$(getopt -n "${my_name}" -o "${o}" -l "${O}" -- "${@}")"
     eval set -- "${opts}"
 
     random=0
+    toolchains_csv="${TOOLCHAINS_CSV}"
     while [ ${#} -gt 0 ]; do
         case "${1}" in
         (-h|--help)
@@ -32,6 +33,9 @@ main() {
         (-r|--random)
             random="${2}"; shift 2
             ;;
+        (-t|--toolchains-csv)
+            toolchains_csv="${2}"; shift 2
+            ;;
         (--)
             shift; break
             ;;
@@ -50,7 +54,7 @@ main() {
     # 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
-    toolchains=($(sed -r -e 's/,.*//; /internal/d;' "${TOOLCHAINS_CSV}" \
+    toolchains=($(sed -r -e 's/,.*//; /internal/d;' "${toolchains_csv}" \
                   |if [ ${random} -gt 0 ]; then \
                       sort -R |head -n ${random}
                    else
@@ -144,8 +148,13 @@ 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.
 
-The list of toolchains is retrieved from the Buildroot autobuilders, available
-at ${TOOLCHAINS_URL}.
+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.
 
 Options:
 
@@ -167,6 +176,11 @@ Options:
         Limit the tests to the N randomly selected toolchains, instead of
         building with all toolchains.
 
+    -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.
+
 Example:
 
     Testing libcec would require a config snippet that contains:
Signature · 1 line
2.13.2
#1 lore raw

PATCH 2/2 utils/readme.txt: add documentation of genrandconfig

---
 utils/readme.txt | 5 +++++
 1 file changed, 5 insertions(+)
utils/readme.txt +5 -0
index fd20e8ee67..3064ecec32 100644
@@ -15,6 +15,11 @@ check-package
     a script that checks the coding style of a package's Config.in and
     .mk files, and also tests them for various types of typoes.
 
+genrandconfig
+    a script that generates a random configuration, used by the autobuilders
+    (http://autobuild.buildroot.org). It selects a random toolchain from
+    support/config-fragments/autobuild and randomly selects packages to build.
+
 get-developpers
     a script to return the list of people interested in a specific part
     of Buildroot, so they can be Cc:ed on a mail. Accepts a patch as
Signature · 1 line
2.13.2
#2 lore raw

PATCH 1/2 utils/test-pkg: add option to use an alternate toolchains CSV file

In reply to Arnout Vandecappelle (Essensium/Mind)

Hello,

Quoted 10 lines · Arnout Vandecappelle (Essensium/Mind)

When testing a package with test-pkg, it may be useful to override the set of toolchains used. For example:
- to test with toolchains used in your company;
- to test agains a subset that is known to be problematic;
- to use only toolchains you already have available locally when you have no network access.

Add an option to use an alternate CSV file containing the config fragments of toolchains to try.

Quoted 7 lines

---
v8: reformulate commit message
v7: CSV file instead of directory
v6: s/defconfig/config fragment/g
v5: First version

Both applied to master. Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com