From: Masami Hiramatsu <mhiramat@kernel.org>
To: Shuah Khan <shuah@kernel.org>
Cc: Juerg Haefliger <juerg.haefliger@canonical.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ingo Molnar <mingo@redhat.com>,
linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH selftests 2/2] selftests/ftrace: Add checkbashisms meta-testcase
Date: Fri, 22 Feb 2019 10:27:25 +0900 [thread overview]
Message-ID: <155079884527.5157.14848621451304431136.stgit@devbox> (raw)
In-Reply-To: <155079878723.5157.12433171255092403676.stgit@devbox>
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>
---
tools/testing/selftests/ftrace/ftracetest | 1 +
.../selftests/ftrace/test.d/selftest/bashisms.tc | 21 ++++++++++++++++++++
2 files changed, 22 insertions(+)
create mode 100644 tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
diff --git a/tools/testing/selftests/ftrace/ftracetest b/tools/testing/selftests/ftrace/ftracetest
index 75244db70331..72b6df37cdb9 100755
--- a/tools/testing/selftests/ftrace/ftracetest
+++ b/tools/testing/selftests/ftrace/ftracetest
@@ -313,6 +313,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
diff --git a/tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc b/tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
new file mode 100644
index 000000000000..1b081e910e14
--- /dev/null
+++ b/tools/testing/selftests/ftrace/test.d/selftest/bashisms.tc
@@ -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
next prev parent reply other threads:[~2019-02-22 1:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-22 1:26 [PATCH selftests 0/2] Add checkbashisms meta-testcase Masami Hiramatsu
2019-02-22 1:26 ` [PATCH selftests 1/2] selftests/ftrace: Make a script checkbashisms clean Masami Hiramatsu
2019-02-22 1:27 ` Masami Hiramatsu [this message]
2019-03-23 10:27 ` [PATCH selftests 0/2] Add checkbashisms meta-testcase Masami Hiramatsu
2019-05-24 2:31 ` Steven Rostedt
2019-05-24 3:02 ` shuah
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=155079884527.5157.14848621451304431136.stgit@devbox \
--to=mhiramat@kernel.org \
--cc=juerg.haefliger@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).