[sheepdog] [PATCH v2 3/4] test: add new option -c for correcting logs

Liu Yuan namei.unix at gmail.com
Tue Feb 5 04:06:02 CET 2013


On 02/05/2013 10:49 AM, Hitoshi Mitake wrote:
> From: Hitoshi Mitake <mitake.hitoshi at gmail.com>
> 
> If -c is passed, check will correct logs produced by sheeps in the
> directory tests/logs/ after completion of tests.
> 

I think we can simply assemble the logs unconditionally, then people are
free to look at it or not.

> Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> ---
>  tests/check |   27 ++++++++++++++++++++++++++-
>  1 files changed, 26 insertions(+), 1 deletions(-)
> 
> diff --git a/tests/check b/tests/check
> index 9f47aeb..3ad636a 100755
> --- a/tests/check
> +++ b/tests/check
> @@ -64,6 +64,7 @@ expunge=true
>  have_test_arg=false
>  randomize=false
>  valgrind=false
> +correct_logs=false
>  rm -f $tmp.list $tmp.tmp $tmp.sed
>  
>  for r
> @@ -145,7 +146,8 @@ check options
>      -n			show me, do not run tests
>      -T			output timestamps
>      -r 			randomize test order
> -    
> +    -c 			correct logs of sheeps
> +
>  testlist options
>      -g group[,group...]	include tests from these groups
>      -x group[,group...]	exclude tests from these groups
> @@ -213,6 +215,10 @@ testlist options
>  	    xgroup=true
>  	    xpand=false
>  	    ;;
> +	-c)
> +	    correct_logs=true
> +	    xpand=false
> +	    ;;
>  	'[0-9][0-9][0-9] [0-9][0-9][0-9][0-9]')
>  	    echo "No tests?"
>  	    status=1
> @@ -523,6 +529,25 @@ do
>      seq="after_$seq"
>  done
>  
> +if $correct_logs
> +then
> +    if [ ! -d logs ]
> +    then
> +	mkdir logs
> +    fi
> +
> +    # FIXME: how can I determine maximum number of sheeps?

I think 'find' will do the trick.

Thanks,
Yuan



More information about the sheepdog mailing list