From patchwork Fri Jul 21 01:05:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 791825 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xDCK83GVPz9s74 for ; Fri, 21 Jul 2017 11:06:52 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B619330BCD; Fri, 21 Jul 2017 01:06:49 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id vnayJfGss7qF; Fri, 21 Jul 2017 01:06:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 69EE43046F; Fri, 21 Jul 2017 01:06:47 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id B78F91C444E for ; Fri, 21 Jul 2017 01:06:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B2200886F3 for ; Fri, 21 Jul 2017 01:06:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MZkwePJvwXkM for ; Fri, 21 Jul 2017 01:06:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exchange.essensium.com (220.77.144.195.ipv4.evonet.be [195.144.77.220]) by fraxinus.osuosl.org (Postfix) with ESMTPS id C57A2886E8 for ; Fri, 21 Jul 2017 01:06:04 +0000 (UTC) Received: from localhost.localdomain (10.3.7.11) by beleexch01.local.ess-mail.com (10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Fri, 21 Jul 2017 03:05:47 +0200 From: "Arnout Vandecappelle (Essensium/Mind)" To: Date: Fri, 21 Jul 2017 03:05:25 +0200 Message-ID: <20170721010530.4747-19-arnout@mind.be> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170721010530.4747-1-arnout@mind.be> References: <20170721010530.4747-1-arnout@mind.be> MIME-Version: 1.0 X-Originating-IP: [10.3.7.11] X-ClientProxiedBy: beleexch01.local.ess-mail.com (10.3.7.8) To beleexch01.local.ess-mail.com (10.3.7.8) Cc: Thomas Petazzoni , "Yann E. MORIN" Subject: [Buildroot] [PATCH v7 18/23] support/test-pkg: add option to use an alternate toolchains CSV file X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" For now, testing a package requires network access. However, there are situations where everything is already cached locally (especially the toolchains tarballs) and network is not available (e.g. in the train, travelling back from FOSDEM...) Alternatively, one may also want to test against a subset of the default toolchains (e.g. the ones known to have a specific issue), or against additional toolchains (e.g. the ones used within the company). Add an option to use an alternate CSV file containing the config fragments of toolchains to try. Cc: "Yann E. MORIN" Signed-off-by: Arnout Vandecappelle (Essensium/Mind) --- 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(-) diff --git a/utils/test-pkg b/utils/test-pkg index 8c60649b32..7eb9c535c3 100755 --- a/utils/test-pkg +++ b/utils/test-pkg @@ -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 @@ -146,8 +150,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: @@ -169,6 +178,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: