From 51658498c41f46950b6a418589b371c8ae8c09da Mon Sep 17 00:00:00 2001 From: Ruediger Meier Date: Wed, 17 Feb 2016 13:03:11 +0100 Subject: build-sys: portable usage of find command - use dot instead of skipping search-path - avoid -perm /a+x - avoid -path Signed-off-by: Ruediger Meier --- tests/run.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests/run.sh') diff --git a/tests/run.sh b/tests/run.sh index dca9c6c54..03cd9f5c2 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -34,6 +34,13 @@ function num_cpus() fi } +function find_test_scripts() +{ + local searchdir="$1" + find "$searchdir" -type f -regex ".*/[^\.~]*" \ + \( -perm -u=x -o -perm -g=x -o -perm -o=x \) +} + while [ -n "$1" ]; do case "$1" in --force) @@ -117,7 +124,7 @@ if [ -n "$SUBTESTS" ]; then # selected tests only for s in $SUBTESTS; do if [ -d "$top_srcdir/tests/ts/$s" ]; then - comps+=( $(find $top_srcdir/tests/ts/$s -type f -perm /a+x -regex ".*/[^\.~]*") ) + comps+=( $(find_test_scripts "$top_srcdir/tests/ts/$s") ) || exit 1 else echo "Unknown test component '$s'" exit 1 @@ -129,7 +136,7 @@ else exit 1 fi - comps=( $(find $top_srcdir/tests/ts/ -type f -perm /a+x -regex ".*/[^\.~]*") ) + comps=( $(find_test_scripts "$top_srcdir/tests/ts") ) || exit 1 fi if [ -n "$EXCLUDETESTS" ]; then -- cgit v1.2.3-55-g7522