]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: Use proper word splitting when executing tests
authorFilipe Brandenburger <filbranden@google.com>
Wed, 10 Aug 2016 20:17:12 +0000 (13:17 -0700)
committerFilipe Brandenburger <filbranden@google.com>
Wed, 10 Aug 2016 20:37:43 +0000 (13:37 -0700)
Use the shell special variable "$@" instead of the inferior $* to
execute the test command in ts_valgrind.  The expansion of "$@" respects
proper word splitting and makes it possible to pass the command empty
arguments.  It might also prevent surprises with quoting in corner
cases.

Tested that `make check` passes.

Valgrind run with `make check TS_OPTS='--nonroot --memcheck'` passes.

Signed-off-by: Filipe Brandenburger <filbranden@google.com>
tests/functions.sh

index b9a8523652bdae2b8ad2d973b31a7d2d3d4947d8..609cedffde6953361432ff0b95840d5aa32c9c51 100644 (file)
@@ -367,11 +367,11 @@ function ts_init_py {
 
 function ts_valgrind {
        if [ -z "$TS_VALGRIND_CMD" ]; then
-               $*
+               "$@"
        else
                $TS_VALGRIND_CMD --tool=memcheck --leak-check=full \
                                 --leak-resolution=high --num-callers=20 \
-                                --log-file="$TS_VGDUMP" $*
+                                --log-file="$TS_VGDUMP" "$@"
        fi
 }