selftests/ftrace: Add checkbashisms meta-testcase
Add a meta-testcase which tests ftracetest itself with checkbasisms. This helps us to keep our test script bashisms clean. Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
This commit is contained in:
parent
3fda9b33d6
commit
4a075bd4e1
@ -318,6 +318,7 @@ run_test() { # testfile
|
||||
local testlog=/proc/self/fd/1
|
||||
fi
|
||||
export TMPDIR=`mktemp -d /tmp/ftracetest-dir.XXXXXX`
|
||||
export FTRACETEST_ROOT=$TOP_DIR
|
||||
echo "execute$INSTANCE: "$1 > $testlog
|
||||
SIG_RESULT=0
|
||||
if [ $VERBOSE -eq -1 ]; then
|
||||
|
21
tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
Normal file
21
tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
Normal file
@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# description: Meta-selftest: Checkbashisms
|
||||
|
||||
if [ ! -f $FTRACETEST_ROOT/ftracetest ]; then
|
||||
echo "Hmm, we can not find ftracetest"
|
||||
exit_unresolved
|
||||
fi
|
||||
|
||||
if ! which checkbashisms > /dev/null 2>&1 ; then
|
||||
echo "No checkbashisms found. skipped."
|
||||
exit_unresolved
|
||||
fi
|
||||
|
||||
checkbashisms $FTRACETEST_ROOT/ftracetest
|
||||
checkbashisms $FTRACETEST_ROOT/test.d/functions
|
||||
for t in $(find $FTRACETEST_ROOT/test.d -name \*.tc); do
|
||||
checkbashisms $t
|
||||
done
|
||||
|
||||
exit 0
|
Loading…
Reference in New Issue
Block a user