From eb9bba20e7a0d673ee52594ea80f70cd75318981 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 13 Sep 2023 19:05:07 +0200 Subject: 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 Signed-off-by: Florian Westphal --- tests/shell/run-tests.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'tests/shell/run-tests.sh') 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 -- cgit v1.2.3