Commit 32ddd082 authored by Veronika Molnarova's avatar Veronika Molnarova Committed by Arnaldo Carvalho de Melo

perf testsuite: Fix shellcheck warnings

Shellcheck is becoming a standard when building perf to prevent
any unnecessary mistakes. Fix shellcheck warnings in perf testsuite.
Signed-off-by: default avatarVeronika Molnarova <vmolnaro@redhat.com>
Cc: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20240702110849.31904-5-vmolnaro@redhat.comSigned-off-by: default avatarMichael Petlan <mpetlan@redhat.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a3a02a52
......@@ -26,8 +26,8 @@ print_results()
PERF_RETVAL="$1"; shift
CHECK_RETVAL="$1"; shift
FAILURE_REASON=""
TASK_COMMENT="$@"
if [ $PERF_RETVAL -eq 0 -a $CHECK_RETVAL -eq 0 ]; then
TASK_COMMENT="$*"
if [ $PERF_RETVAL -eq 0 ] && [ $CHECK_RETVAL -eq 0 ]; then
_echo "$MPASS-- [ PASS ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $TASK_COMMENT"
return 0
else
......@@ -56,7 +56,7 @@ print_overall_results()
print_testcase_skipped()
{
TASK_COMMENT="$@"
TASK_COMMENT="$*"
_echo "$MSKIP-- [ SKIP ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $TASK_COMMENT :: testcase skipped"
return 0
}
......@@ -69,7 +69,7 @@ print_overall_skipped()
print_warning()
{
WARN_COMMENT="$@"
WARN_COMMENT="$*"
_echo "$MWARN-- [ WARN ] --$MEND $TEST_NAME :: $THIS_TEST_NAME :: $WARN_COMMENT"
return 0
}
......
......@@ -45,7 +45,7 @@ export TEST_IGNORE_MISSING_PMU=${TEST_IGNORE_MISSING_PMU:-n}
export LC_ALL=C
#### colors
if [ -t 1 -o "$TESTLOG_FORCE_COLOR" = "yes" ]; then
if [ -t 1 ] || [ "$TESTLOG_FORCE_COLOR" = "yes" ]; then
export MPASS="\e[32m"
export MALLPASS="\e[1;32m"
export MFAIL="\e[31m"
......@@ -68,15 +68,15 @@ fi
### general info
DIR_PATH=`dirname "$(readlink -e "$0")"`
export TEST_NAME=`basename $DIR_PATH | sed 's/base/perf/'`
export MY_ARCH=`arch`
TEST_NAME=`basename $DIR_PATH | sed 's/base/perf/'`; export TEST_NAME
MY_ARCH=`arch`; export MY_ARCH
# storing logs and temporary files variables
if [ -n "$PERFSUITE_RUN_DIR" ]; then
# when $PERFSUITE_RUN_DIR is set to something, all the logs and temp files will be placed there
# --> the $PERFSUITE_RUN_DIR/perf_something/examples and $PERFSUITE_RUN_DIR/perf_something/logs
# dirs will be used for that
export PERFSUITE_RUN_DIR=`readlink -f $PERFSUITE_RUN_DIR`
PERFSUITE_RUN_DIR=`readlink -f $PERFSUITE_RUN_DIR`; export PERFSUITE_RUN_DIR
export CURRENT_TEST_DIR="$PERFSUITE_RUN_DIR/$TEST_NAME"
export MAKE_TARGET_DIR="$CURRENT_TEST_DIR/examples"
export LOGS_DIR="$CURRENT_TEST_DIR/logs"
......@@ -93,6 +93,7 @@ fi
if [ ! -d ./common ]; then
# set parameters based on runmode
if [ -f ../common/parametrization.$PERFTOOL_TESTSUITE_RUNMODE.sh ]; then
# shellcheck source=/dev/null
. ../common/parametrization.$PERFTOOL_TESTSUITE_RUNMODE.sh
fi
# if some parameters haven't been set until now, set them to default
......
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