From 1df962844790aa988156f47e9f11c4855034b380 Mon Sep 17 00:00:00 2001 From: Frank Liepold Date: Wed, 8 Jan 2014 10:18:31 +0100 Subject: [PATCH] test_suite: beautify output of start_test.sh --- test_suite/README | 10 +++++++++- test_suite/scripts/modules/lib.sh | 4 ---- test_suite/scripts/start_test.sh | 16 ++++++++++------ 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/test_suite/README b/test_suite/README index 0349b1cf..c3488c7b 100644 --- a/test_suite/README +++ b/test_suite/README @@ -91,10 +91,18 @@ subdirectory (we call it start directory) as follows: The output fo start_test.sh consists of the following sections: +- List titled "Sourcing libraries in " of included scripts + from /lib*.sh + - List titled "Sourcing modules and default configuration" of included scripts - from scripts/modules/*.sh and corresponding included default-*.conf files. + from scripts/modules/[0-9]*.sh and corresponding included default-*.conf + files. + +- Line titled "Scanning subdirectories of " followed by a + list of ignored or skipped subdirectories - Per leaf directory: + - Line titled "Testdirectory " - List titled "Sourcing config files between and " of included *.conf files corresponding to the directory structure. diff --git a/test_suite/scripts/modules/lib.sh b/test_suite/scripts/modules/lib.sh index d49cfe80..d054dfca 100644 --- a/test_suite/scripts/modules/lib.sh +++ b/test_suite/scripts/modules/lib.sh @@ -17,10 +17,6 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -if (( !noecho )); then - echo "Sourcing lib.sh" -fi - # this may be later overridden by distros / install scripts / etc # $sript_dir is assumed to be already set by the caller diff --git a/test_suite/scripts/start_test.sh b/test_suite/scripts/start_test.sh index 4d0cd12f..cded12ba 100755 --- a/test_suite/scripts/start_test.sh +++ b/test_suite/scripts/start_test.sh @@ -26,11 +26,13 @@ shopt -s extdebug # Use directory names as basis for configuration variants script_dir="$(cd "$(dirname "$(which "$0")")"; pwd)" -echo "========================== Sourcing modules and default configuration ==========" -for lib in $script_dir/modules/lib*.sh; do +lib_dir=$script_dir/modules +echo "========================== Sourcing libraries in $lib_dir ======================" +for lib in $lib_dir/lib*.sh; do + echo "Sourcing $lib" source "$lib" || exit $? done -echo "========================== End sourcing modules and default configuration ======" +echo "========================== End sourcing libraries ==============================" to_produce="${to_produce:-replay.gz}" to_check="${to_check:-}" @@ -140,9 +142,11 @@ function print_config_environment save_environment # for later use in print_config_environment shopt -s nullglob +echo "========================== Sourcing modules and default configuration ==========" for module in $module_dir/[0-9]*.sh; do source_module "$module" done +echo "========================== End sourcing modules and default configuration ======" # parse options. while [ $# -ge 1 ]; do @@ -180,7 +184,7 @@ ignore_cmd="grep -v '[/.]old' | grep -v 'ignore'" sort_cmd="while read i; do if [ -e \"\$i\"/prio-[0-9]* ]; then echo \"\$(cd \$i; ls prio-[0-9]*):\$i\"; else echo \"z:\$i\"; fi; done | sort | sed 's/^[^:]*://'" # find directories -echo "================= Sourcing config files between $config_root_dir and $(pwd) ===" +echo "================= Scanning subdirectories of $(pwd) ============================" for test_dir in $(find . -type d | eval "$ignore_cmd" | eval "$sort_cmd"); do (( dry_run_script )) || rm -f $test_dir/dry-run.$to_produce if [ -e "$test_dir/skip" ]; then @@ -201,8 +205,7 @@ for test_dir in $(find . -type d | eval "$ignore_cmd" | eval "$sort_cmd"); do continue fi echo "" - echo "===============================================================" - echo "======== $test_dir" + echo "================= Testdirectory $test_dir ======================================" if [ -e "$test_dir/stop" ] || [ -e "./stop" ]; then echo "would start $test_dir" echo "echo stopping due to stop file." @@ -210,6 +213,7 @@ for test_dir in $(find . -type d | eval "$ignore_cmd" | eval "$sort_cmd"); do fi ( cd $test_dir + echo "================= Sourcing config files between $config_root_dir and $(pwd) ====" # to be able to call error recovery functions in case of signals trap 'lib_exit 1 "caught signal"' SIGHUP SIGINT