[PATCHES] selftest related

Jelmer Vernooij jelmer at samba.org
Sun Oct 12 22:22:25 MDT 2014


On Sun, Oct 12, 2014 at 09:16:19PM -0700, Matthieu Patou wrote:
> From 9f21d3f48b492f38297cecacceca4beb6d540e3f Mon Sep 17 00:00:00 2001
> From: Matthieu Patou <mat at matws.net>
> Date: Sun, 12 Oct 2014 20:59:02 -0700
> Subject: [PATCH 4/4] selftest: add documentation for options --exclude and
>  --include that weren't documented before
> 
> Change-Id: Ibf0fa1c548d376dc8d68ab8136e2532f67dd1d8a
> Signed-off-by: Matthieu Patou <mat at matws.net>
> ---
>  selftest/selftest.pl | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/selftest/selftest.pl b/selftest/selftest.pl
> index f35b063..fdba4d5 100755
> --- a/selftest/selftest.pl
> +++ b/selftest/selftest.pl
> @@ -190,6 +190,8 @@ Generic options:
>   --help                     this help page
>   --target=samba[3]|win      Samba version to target
>   --testlist=FILE            file to read available tests from
> + --exclude=FILE             Exclude tests listed in the file
> + --inlcude=FILE             Include tests listed in the file


^^ s/inlcude/include/

>  
>  Paths:
>   --prefix=DIR               prefix to run tests in [st]
> -- 
> 1.9.1
> 

> From 190ed0d375b022dcefe8c322be3a4d54f3759268 Mon Sep 17 00:00:00 2001
> From: Matthieu Patou <mat at matws.net>
> Date: Sun, 12 Oct 2014 17:57:20 -0700
> Subject: [PATCH 3/4] selftest: report the 10 slowest tests (by default) make
>  the number configurable
> 
> Change-Id: Ib1cf50199d110827a25cf198b40738f3c72cbe17
> Signed-off-by: Matthieu Patou <mat at matws.net>
> ---
>  selftest/wscript | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/selftest/wscript b/selftest/wscript
> index a57f7c1..ff680fb 100644
> --- a/selftest/wscript
> +++ b/selftest/wscript
> @@ -43,6 +43,9 @@ def set_options(opt):
>      gr.add_option('--slow',
>                    help=("enable the really slow tests"),
>                    action="store_true", dest='SLOWTEST', default=False)
> +    gr.add_option('--nb-slowest',
> +                  help=("Show the n slowest tests (10 by defaults)"),
^^ s/defaults/by default/. For consistency, please use "(default=10)" as suffix.

You can specify "type=int, default=10" here and prevent the cludge further down.

> +                  dest='NB_SLOWEST')
>      gr.add_option('--testenv',
>                    help=("start a terminal with the test environment setup"),
>                    action="store_true", dest='TESTENV', default=False)
> @@ -226,6 +229,13 @@ def cmd_testonly(opt):
>          runcmd = EXPAND_VARIABLES(opt, testrcmd)
>          RUN_COMMAND(runcmd, env=env)
>  
> +    if os.path.exists("st/subunit"):
> +        nb = int(getattr(Options.options, 'NB_SLOWEST', 10))
^^ If you set a default in the add_option call, this can just be Options.options.NB_SLOWEST.

> +        print "TOP %d slowest tests" % nb
> +        cmd = "./script/show_testsuite_time ./st/subunit %d" % nb
^^ Please use Options.options.selftest_prefix here rather than ./st.

 
> diff --git a/selftest/selftest.pl b/selftest/selftest.pl
> index f35b063..fdba4d5 100755
> --- a/selftest/selftest.pl
> +++ b/selftest/selftest.pl
> @@ -190,6 +190,8 @@ Generic options:
>   --help                     this help page
>   --target=samba[3]|win      Samba version to target
>   --testlist=FILE            file to read available tests from
> + --exclude=FILE             Exclude tests listed in the file
> + --inlcude=FILE             Include tests listed in the file
^^ s/inlcude/include/

Jelmer


More information about the samba-technical mailing list