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>
}
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