summaryrefslogtreecommitdiffstats
path: root/tests/shell/run-tests.sh
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2023-09-13 19:05:07 +0200
committerFlorian Westphal <fw@strlen.de>2023-09-15 16:04:43 +0200
commiteb9bba20e7a0d673ee52594ea80f70cd75318981 (patch)
treebc37f6f5f07b05c1484d5c44038014be268cbd6c /tests/shell/run-tests.sh
parentac3f685a881e112db37c845566de98bee1bc11ad (diff)
tests/shell: special handle base path starting with "./"
When we auto detect the tests with `tests/shell/run-tests.sh -L`, then commonly the NFT_TEST_BASEDIR starts with a redundant "./". That's a bit ugly. Instead, special handle that case and remove the prefix. The effect is that `tests/shell/run-tests.sh -L` shows tests/shell/testcases/bitwise/0040mark_binop_0 instead of ./tests/shell/testcases/bitwise/0040mark_binop_0 Signed-off-by: Thomas Haller <thaller@redhat.com> Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'tests/shell/run-tests.sh')
-rwxr-xr-xtests/shell/run-tests.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/shell/run-tests.sh b/tests/shell/run-tests.sh
index 1501f90e..12901ab3 100755
--- a/tests/shell/run-tests.sh
+++ b/tests/shell/run-tests.sh
@@ -320,7 +320,9 @@ find_tests() {
}
if [ "${#TESTS[@]}" -eq 0 ] ; then
- TESTS=( $(find_tests "$NFT_TEST_BASEDIR/testcases/") )
+ d="$NFT_TEST_BASEDIR/testcases/"
+ d="${d#./}"
+ TESTS=( $(find_tests "$d") )
test "${#TESTS[@]}" -gt 0 || msg_error "Could not find tests"
if [ -z "$NFT_TEST_SHUFFLE_TESTS" ] ; then
NFT_TEST_SHUFFLE_TESTS=y