Commit 97e49368 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Shuah Khan

selftests: ftrace: Check given string is not zero-length

Use [ ! -z "$VAR" ] instead of [ "$VAR" ] to check
whether the given string variable is not zero-length
since it obviously shows what it means.
Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Acked-by: default avatarSteven Rostedt (VMware) <srostedt@goodmis.org>
Signed-off-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
parent 97bece60
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
# Released under the terms of the GPL v2. # Released under the terms of the GPL v2.
usage() { # errno [message] usage() { # errno [message]
[ "$2" ] && echo $2 [ ! -z "$2" ] && echo $2
echo "Usage: ftracetest [options] [testcase(s)] [testcase-directory(s)]" echo "Usage: ftracetest [options] [testcase(s)] [testcase-directory(s)]"
echo " Options:" echo " Options:"
echo " -h|--help Show help message" echo " -h|--help Show help message"
...@@ -50,7 +50,7 @@ parse_opts() { # opts ...@@ -50,7 +50,7 @@ parse_opts() { # opts
local OPT_TEST_CASES= local OPT_TEST_CASES=
local OPT_TEST_DIR= local OPT_TEST_DIR=
while [ "$1" ]; do while [ ! -z "$1" ]; do
case "$1" in case "$1" in
--help|-h) --help|-h)
usage 0 usage 0
...@@ -96,7 +96,7 @@ parse_opts() { # opts ...@@ -96,7 +96,7 @@ parse_opts() { # opts
;; ;;
esac esac
done done
if [ "$OPT_TEST_CASES" ]; then if [ ! -z "$OPT_TEST_CASES" ]; then
TEST_CASES=$OPT_TEST_CASES TEST_CASES=$OPT_TEST_CASES
fi fi
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment