diff options
author | Arturo Borrero Gonzalez <arturo@debian.org> | 2016-11-16 13:51:52 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-11-24 13:01:16 +0100 |
commit | a7d9df42a8d1b7189d1c7ae23bb513c4b518cf16 (patch) | |
tree | b4fcd0b6c471e00155687de0434a41c6e5baa877 /tests | |
parent | 1ead857d7d5e618178259652bd6b6859a288c675 (diff) |
tests: shell: allow to execute a single testcase
Using, for example:
% sudo ./run-tests.sh testcase/mytest_0
Will result in an execution of this single testcase rather than
the complete suite.
This is useful while working with a concrete testcase.
Signed-off-by: Arturo Borrero Gonzalez <arturo@debian.org>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/shell/run-tests.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh index d9c44c80..4e41893e 100755 --- a/tests/shell/run-tests.sh +++ b/tests/shell/run-tests.sh @@ -43,6 +43,13 @@ if [ ! -x "$MODPROBE" ] ; then msg_error "no modprobe binary found" fi +if [ -x "$1" ] ; then + if grep ^.*${RETURNCODE_SEPARATOR}[0-9]\\+$ <<< $1 >/dev/null ; then + SINGLE=$1 + VERBOSE=y + fi +fi + if [ "$1" == "-v" ] ; then VERBOSE=y fi @@ -65,6 +72,10 @@ kernel_cleanup() { } find_tests() { + if [ ! -z "$SINGLE" ] ; then + echo $SINGLE + return + fi ${FIND} ${TESTDIR} -executable -regex \ .*${RETURNCODE_SEPARATOR}[0-9]+ | sort } |