aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/test-suite
diff options
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-06-25 21:16:07 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2017-12-16 16:21:45 +0100
commitb42541e164764c7d5bc67606f3e39184350f5ad8 (patch)
treeb3905ca810dd3c1ed8848ed80c3b4449aa67150f /validation/test-suite
parent5fec039b49c135e9bd56efd413d5273f2ee734dd (diff)
downloadsparse-dev-b42541e164764c7d5bc67606f3e39184350f5ad8.tar.gz
testsuite: respect command line's quotes & whitespaces
Currently the testsuite use 'eval echo $cmd' to expand the name of the test file to be given on the command line. This has the annoying consequence to go a bit too far in the expansion of variables and to destroy any quotes and whitespaces escaping that would have done. Fix this by doing the eval later, when effectively executing the command. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/test-suite')
-rwxr-xr-xvalidation/test-suite12
1 files changed, 7 insertions, 5 deletions
diff --git a/validation/test-suite b/validation/test-suite
index 192fba30..5655ac40 100755
--- a/validation/test-suite
+++ b/validation/test-suite
@@ -308,25 +308,27 @@ do_test()
fi
fi
- cmd=`eval echo $default_path/$check_command`
-
if [ -z "$vquiet" ]; then
echo " TEST $test_name ($file)"
fi
- verbose "Using command : $cmd"
+ verbose "Using command : $(echo "$@")"
# grab the expected exit value
expected_exit_value=$check_exit_value
verbose "Expecting exit value: $expected_exit_value"
# do we want a timeout?
+ pre_cmd=""
if [ $check_timeout -ne 0 ]; then
- cmd="timeout -k 1s $check_timeout $cmd"
+ pre_cmd="timeout -k 1s $check_timeout"
fi
+ shift
+ # launch the test command and
# grab the actual output & exit value
- $cmd 1> $file.output.got 2> $file.error.got
+ eval $pre_cmd $default_path/$base_cmd "$@" \
+ 1> $file.output.got 2> $file.error.got
actual_exit_value=$?
must_fail=$check_known_to_fail