From e20a3f4e64e0550e7e76ea794078efe76671a6bc Mon Sep 17 00:00:00 2001 From: Abit Date: Thu, 24 Sep 2020 18:01:37 +0200 Subject: [PATCH] Fix run-parallel-tests for chain_test in core --- tests/run-parallel-tests.sh | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/tests/run-parallel-tests.sh b/tests/run-parallel-tests.sh index 6e3dfd11a..eac2c58b5 100755 --- a/tests/run-parallel-tests.sh +++ b/tests/run-parallel-tests.sh @@ -17,23 +17,27 @@ if [ "$BOOST_VERSION" = "" -o "$BOOST_VERSION" -lt 105900 ]; then echo "Boost version '$BOOST_VERSION' - executing tests serially" "$@" else + echo "=== $1 list_content test begin ===" "$1" --list_content 2>&1 \ | grep '\*$' \ - | sed 's=\*$==;s=^ =/=' \ - | while read t; do - case "$t" in - /*) echo "$pre$t"; ;; - *) echo "$t"; ;; - esac - done + | sed 's=\*$==;s=^ =/=' + echo "=== $1 list_content test end ===" "$1" --list_content 2>&1 \ | grep '\*$' \ | sed 's=\*$==;s=^ =/=' \ - | while read t; do - case "$t" in - /*) echo "$pre$t"; ;; - *) echo "$t"; ;; - esac - done \ + | (while read t; do + case "$t" in + /*) echo "$pre$t"; found=1; ;; + *) if [ -n "$pre" -a "$found" = "0" ]; then + echo "$pre" + fi + pre="$t" + found=0 + ;; + esac + done + if [ -n "$pre" -a "$found" = "0" ]; then + echo "$pre" + fi) \ | parallel echo Running {}\; "$@" -t {} fi