Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Masami Hiramatsu and committed by
Shuah Khan
4a075bd4 3fda9b33

+22
+1
tools/testing/selftests/ftrace/ftracetest
··· 318 318 local testlog=/proc/self/fd/1 319 319 fi 320 320 export TMPDIR=`mktemp -d /tmp/ftracetest-dir.XXXXXX` 321 + export FTRACETEST_ROOT=$TOP_DIR 321 322 echo "execute$INSTANCE: "$1 > $testlog 322 323 SIG_RESULT=0 323 324 if [ $VERBOSE -eq -1 ]; then
+21
tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
··· 1 + #!/bin/sh 2 + # SPDX-License-Identifier: GPL-2.0 3 + # description: Meta-selftest: Checkbashisms 4 + 5 + if [ ! -f $FTRACETEST_ROOT/ftracetest ]; then 6 + echo "Hmm, we can not find ftracetest" 7 + exit_unresolved 8 + fi 9 + 10 + if ! which checkbashisms > /dev/null 2>&1 ; then 11 + echo "No checkbashisms found. skipped." 12 + exit_unresolved 13 + fi 14 + 15 + checkbashisms $FTRACETEST_ROOT/ftracetest 16 + checkbashisms $FTRACETEST_ROOT/test.d/functions 17 + for t in $(find $FTRACETEST_ROOT/test.d -name \*.tc); do 18 + checkbashisms $t 19 + done 20 + 21 + exit 0