From 8a810f5fdc5bfe62bc8e8efb2b64454794b97da8 Mon Sep 17 00:00:00 2001 From: Michal Berger Date: Thu, 29 Sep 2022 18:21:25 +0200 Subject: [PATCH] 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 Change-Id: I1aa5d2acfc28cccdee1464462b0350f0cbc346c7 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/14756 Reviewed-by: Tomasz Zawadzki Reviewed-by: Pawel Piatek Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- test/common/autotest_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/autotest_common.sh b/test/common/autotest_common.sh index 92499cfae..70ade3d83 100755 --- a/test/common/autotest_common.sh +++ b/test/common/autotest_common.sh @@ -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