All of lore.kernel.org
 help / color / mirror / Atom feed
From: <Tim.Bird@sony.com>
To: daniel.sangorrin@toshiba.co.jp, fuego@lists.linuxfoundation.org
Subject: Re: [Fuego] [PATCH 1/3] dynvars: add support for simple variable	assignments
Date: Sat, 6 Oct 2018 01:17:00 +0000	[thread overview]
Message-ID: <ECADFF3FD767C149AD96A924E7EA6EAF80516C2B@USCULXMSG01.am.sony.com> (raw)
In-Reply-To: <1538703055-9252-2-git-send-email-daniel.sangorrin@toshiba.co.jp>

Applied.  Nice!  Thanks very much.
 -- Tim

> -----Original Message-----
> From: fuego-bounces@lists.linuxfoundation.org [mailto:fuego-
> bounces@lists.linuxfoundation.org] On Behalf Of Daniel Sangorrin
> Sent: Thursday, October 04, 2018 6:31 PM
> To: fuego@lists.linuxfoundation.org
> Subject: [Fuego] [PATCH 1/3] dynvars: add support for simple variable
> assignments
> 
> Before dynamic-vars require a python dictionary style notation
> to define dynamic variables. This was an overkill for simple
> variable assignments, as Tim noted. For that reason, this patch
> introduces support for simple variable assignments in the
> form of "VAR1=VALUE1,VAR2=VALUE2". Internally, these are parsed
> and converted into a python dictionary.
> 
> Signed-off-by: Daniel Sangorrin <daniel.sangorrin@toshiba.co.jp>
> ---
>  engine/scripts/ftc | 14 +++++++++++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/engine/scripts/ftc b/engine/scripts/ftc
> index 4ab4ef2..23f09ca 100755
> --- a/engine/scripts/ftc
> +++ b/engine/scripts/ftc
> @@ -243,7 +243,7 @@ You can obtain a list of run_ids for runs on the local
> system with
>      """Usage: ftc run-test -b <board> -t <test> [-s <spec>] [-p <phases>]
>      [-k <kill timeout>] [--rebuild <true|false>] [--reboot <true|false>]
>      [--precleanup <true|false>] [--postcleanup <true|false>]
> -    [--dynamic-vars python_dict]
> +    [--dynamic-vars variable assignments or python_dict]
>  Run the indicated test on the specified board.  Use the
>  indicated spec, if one is provided.
> 
> @@ -254,6 +254,7 @@ reboot: if true reboot the board before the test.
>  precleanup: if true clean the board's test folder before the test.
>  postcleanup: if true clean the board's test folder after the test.
>  dynamic-vars: allows overriding the variables in a spec from the command
> line.
> +  Example: ftc run-test -b bbb -t Functional.bc -s bc-add --dynamic-vars
> "EXPR=3+4,RESULT=7"
>    Example: ftc run-test -b bbb -t Benchmark.Dhrystone --dynamic-vars
> "{'LOOPS':'400000000'}"
> 
>  A list of phase characters may be provided, to execute only those phases
> @@ -3366,9 +3367,16 @@ def do_run_test(conf, options):
> 
>      if '--dynamic-vars' in options:
>          try:
> -            import ast
>              dyn_vars_str = options[options.index('--dynamic-vars') + 1]
> -            dyn_vars = ast.literal_eval(dyn_vars_str)
> +            if dyn_vars_str[0] == '{':
> +                import ast
> +                dyn_vars = ast.literal_eval(dyn_vars_str)
> +            else:
> +                dyn_vars = dict()
> +                for var_definition in dyn_vars_str.split(','):
> +                    key = var_definition.split('=')[0]
> +                    value = var_definition.split('=')[1]
> +                    dyn_vars[key] = value
>          except IndexError:
>              error_out('Dynamic vars not provided after --dynamic-vars.')
>          options.remove(dyn_vars_str)
> --
> 2.7.4
> 
> _______________________________________________
> Fuego mailing list
> Fuego@lists.linuxfoundation.org
> https://urldefense.proofpoint.com/v2/url?u=https-
> 3A__lists.linuxfoundation.org_mailman_listinfo_fuego&d=DwICAg&c=fP4tf-
> -1dS0biCFlB0saz0I0kjO5v7-
> GLPtvShAo4cc&r=jjTc71ylyJg68rRxrFQuDFMMybIqPCnrHF85A-
> GzCRg&m=Ax3UE4Q_TSiyOQp63MESwdu6nz4J5pziqaltl_It1ec&s=Y1JMS9eZy
> fwNgYmusPVL22H1AV-FbJ5u3zyg6yofiv4&e=

  reply	other threads:[~2018-10-06  1:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05  1:30 [Fuego] A few fixes and a bug report Daniel Sangorrin
2018-10-05  1:30 ` [Fuego] [PATCH 1/3] dynvars: add support for simple variable assignments Daniel Sangorrin
2018-10-06  1:17   ` Tim.Bird [this message]
2018-10-05  1:30 ` [Fuego] [PATCH 2/3] run-test: use makedirs instead of mkdir Daniel Sangorrin
2018-10-06  1:16   ` Tim.Bird
2018-10-05  1:30 ` [Fuego] [PATCH 3/3] ovgen: remove test spec strip and generation code Daniel Sangorrin
2018-10-06  1:15   ` Tim.Bird
2018-10-05  1:39 ` [Fuego] A few fixes and a bug report Tim.Bird

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ECADFF3FD767C149AD96A924E7EA6EAF80516C2B@USCULXMSG01.am.sony.com \
    --to=tim.bird@sony.com \
    --cc=daniel.sangorrin@toshiba.co.jp \
    --cc=fuego@lists.linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.