From d61ec0f059256c5e32003325fef6e8fd63fa2ed4 Mon Sep 17 00:00:00 2001 From: Alberto Escolar Piedras Date: Thu, 26 Oct 2023 16:15:24 +0200 Subject: [PATCH] tests/bsim run_parallel: Allow TESTS_FILE with search paths With TESTS_FILE the user could provide a file with a list of tests to run. Now we also support that file containing a mix of tests and paths in which to search for tests. Signed-off-by: Alberto Escolar Piedras --- tests/bsim/run_parallel.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/bsim/run_parallel.sh b/tests/bsim/run_parallel.sh index 9d6b498878ea335..80e74512ef3addf 100755 --- a/tests/bsim/run_parallel.sh +++ b/tests/bsim/run_parallel.sh @@ -13,8 +13,8 @@ function display_help(){ echo " Testcases are searched for in \${SEARCH_PATH}," echo " which by default is the folder the script is run from" echo " You can instead also provide a space separated test list with \${TESTS_LIST}, " - echo " or an input file including a list of tests \${TESTS_FILE} (w one line" - echo " per test, you can comment lines with #)" + echo " or an input file including a list of tests and/or tests search paths" + echo " \${TESTS_FILE} (w one line per test/path, you can comment lines with #)" echo "" echo " Examples (run from \${ZEPHYR_BASE}):" echo " * Run all tests found under one folder:" @@ -44,7 +44,9 @@ i=0 if [ -n "${TESTS_FILE}" ]; then #remove comments and empty lines from file - all_cases=$(sed 's/#.*$//;/^$/d' "${TESTS_FILE}") + search_pattern=$(sed 's/#.*$//;/^$/d' "${TESTS_FILE}") || exit 1 + all_cases=`find ${search_pattern} -name "*.sh" | \ + grep -Ev "(/_|run_parallel|compile|generate_coverage_report.sh)"` elif [ -n "${TESTS_LIST}" ]; then all_cases=${TESTS_LIST} else