[PATCH 1/6] perf-test: use 'eval' in memory_run

Tomi Ollila tomi.ollila at iki.fi
Sat Mar 18 14:04:24 PDT 2017


On Sat, Mar 18 2017, David Bremner <david at tethera.net> wrote:

> This allows the use of redirection in the tests
> ---
>  performance-test/perf-test-lib.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/performance-test/perf-test-lib.sh b/performance-test/perf-test-lib.sh
> index 00d2f1c6..c89d5aab 100644
> --- a/performance-test/perf-test-lib.sh
> +++ b/performance-test/perf-test-lib.sh
> @@ -149,7 +149,7 @@ memory_run ()
>  
>      printf "[ %d ]\t%s\n" $test_count "$1"
>  
> -    NOTMUCH_TALLOC_REPORT="$talloc_log" valgrind --leak-check=full --log-file="$log_file" $2
> +    NOTMUCH_TALLOC_REPORT="$talloc_log" eval "valgrind --leak-check=full --log-file='$log_file' $2"

For the record, this would have worked w/o the double quotes (which I
thought would have not), but it is somewhat safer for someone to copy
this to some use. If there were literal '>'s in the line, then those
redirections would have been done in 'eval' (with these quotes). Without
quotes, '>' redirection would have been done before 'eval'. But 
when '>' is given in variable $2, the redirection would have been
done in eval (after shell has expanded the line for it) in any case.

all that said, this particular change OK...

Tomi

>  
>      awk '/LEAK SUMMARY/,/suppressed/ { sub(/^==[0-9]*==/," "); print }' "$log_file"
>      echo



More information about the notmuch mailing list