test/common: Separate grep runs with a newline while creating a tests list

Without this, the second run of grep adds output directly behind the
last line of the first one. This results in the last test (from the
first run) always being filtered out from the list by the next sed
call.

Signed-off-by: Michal Berger <michal.berger@intel.com>
Change-Id: I1aa5d2acfc28cccdee1464462b0350f0cbc346c7
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14756
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Pawel Piatek <pawelx.piatek@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
Michal Berger 2022-09-29 18:21:25 +02:00 committed by Tomasz Zawadzki
parent 96679a2910
commit 8a810f5fdc

View File

@ -661,7 +661,7 @@ function create_test_list() {
# First search all scripts in main SPDK directory.
completion=$(grep -shI -d skip --include="*.sh" -e "run_test " $rootdir/*)
# Follow up with search in test directory recursively.
completion+=$(grep -rshI --include="*.sh" --exclude="*autotest_common.sh" -e "run_test " $rootdir/test)
completion+=$'\n'$(grep -rshI --include="*.sh" --exclude="*autotest_common.sh" -e "run_test " $rootdir/test)
printf "%s" "$completion" | grep -v "#" \
| sed 's/^.*run_test/run_test/' | awk '{print $2}' \
| sed 's/\"//g' | sort > $output_dir/all_tests.txt || true