diff --git a/autoconf/scripts/run-test.sh b/autoconf/scripts/run-test.sh index 6be2052..3e01813 100755 --- a/autoconf/scripts/run-test.sh +++ b/autoconf/scripts/run-test.sh @@ -54,7 +54,7 @@ for testScript in ${selectedTests}; do numberOfTests=$((1+numberOfTests)) testScriptLeaf="${testScript##*/}" - testName="$(echo "${testScriptLeaf}" | sed 's/-/ - /' | tr '_' ' ')" + testName="$(echo "${testScriptLeaf%.sh}" | tr '_' ' ' | sed 's/ - /: /')" testNameLength=${#testName} test "${testNameLength}" -gt "${maxTestNameLength}" && maxTestNameLength="${testNameLength}" done @@ -83,7 +83,7 @@ for testScript in ${selectedTests}; do testNumber=$((1+testNumber)) testScriptLeaf="${testScript##*/}" - testName="$(echo "${testScriptLeaf}" | sed 's/-/ - /' | tr '_' ' ')" + testName="$(echo "${testScriptLeaf%.sh}" | tr '_' ' ' | sed 's/ - /: /')" printf "%${testCountWidth}d/%d: %-${maxTestNameLength}.${maxTestNameLength}s " "${testNumber}" "${numberOfTests}" "${testName}" # Run the test script, capturing the output and the exit status. @@ -107,20 +107,24 @@ for testScript in ${selectedTests}; do overallExitStatus=1 fi - # If there was any output from the test, prefix it with " - " to - # separate it from the test result description. - test -n "${testOutput}" && testOutput=" - ${testOutput}" - # If stdout is not a terminal, don't use terminal format codes. test -t 1 || resultFormatCodes="" - # Show the description of the test result. + # Show the description of the test result, and start a new line. test -n "${resultFormatCodes}" && command -v tput >/dev/null 2>&1 && echo "${resultFormatCodes}" | tr ';' '\n' | tput -S 2>/dev/null printf "%s" "${testResultDescription}" test -n "${resultFormatCodes}" && command -v tput >/dev/null 2>&1 && tput sgr0 2>/dev/null + printf "\n" - # Show any output from the test, and start a new line. - printf "%s\n" "${testOutput}" + # If there was any output from the test, display it on the new line, + # with the same terminal format codes as the result description, and + # each line prefixed with the test number. + if test -n "${testOutput}"; then + test -n "${resultFormatCodes}" && command -v tput >/dev/null 2>&1 && echo "${resultFormatCodes}" | tr ';' '\n' | tput -S 2>/dev/null + printf "%s" "$(echo "${testOutput}" | sed "s,^,$(printf "%${testCountWidth}d/%d: " "${testNumber}" "${numberOfTests}"),")" + test -n "${resultFormatCodes}" && command -v tput >/dev/null 2>&1 && tput sgr0 2>/dev/null + printf "\n" + fi done # Clean up. diff --git a/tests/014-1m_boundary_1 b/tests/Bug_-_Display_length_at_magnitude_boundary_-_Bytes.sh similarity index 100% rename from tests/014-1m_boundary_1 rename to tests/Bug_-_Display_length_at_magnitude_boundary_-_Bytes.sh diff --git a/tests/015-1m_boundary_2 b/tests/Bug_-_Display_length_at_magnitude_boundary_-_Rate.sh similarity index 100% rename from tests/015-1m_boundary_2 rename to tests/Bug_-_Display_length_at_magnitude_boundary_-_Rate.sh diff --git a/tests/013-averagerate b/tests/Display_-_--average-rate.sh similarity index 100% rename from tests/013-averagerate rename to tests/Display_-_--average-rate.sh diff --git a/tests/008-bytes b/tests/Display_-_--bytes.sh similarity index 100% rename from tests/008-bytes rename to tests/Display_-_--bytes.sh diff --git a/tests/005-eta b/tests/Display_-_--eta_-_plausible_values.sh similarity index 100% rename from tests/005-eta rename to tests/Display_-_--eta_-_plausible_values.sh diff --git a/tests/006-fineta b/tests/Display_-_--fineta_-_plausible_values.sh similarity index 100% rename from tests/006-fineta rename to tests/Display_-_--fineta_-_plausible_values.sh diff --git a/tests/009-numeric b/tests/Display_-_--numeric.sh similarity index 100% rename from tests/009-numeric rename to tests/Display_-_--numeric.sh diff --git a/tests/018-numeric-bytes b/tests/Display_-_--numeric_--bytes.sh similarity index 100% rename from tests/018-numeric-bytes rename to tests/Display_-_--numeric_--bytes.sh diff --git a/tests/017-numeric-timer b/tests/Display_-_--numeric_--timer.sh similarity index 100% rename from tests/017-numeric-timer rename to tests/Display_-_--numeric_--timer.sh diff --git a/tests/003-progress b/tests/Display_-_--progress_-_basic_movement.sh similarity index 100% rename from tests/003-progress rename to tests/Display_-_--progress_-_basic_movement.sh diff --git a/tests/010-quiet b/tests/Display_-_--quiet.sh similarity index 100% rename from tests/010-quiet rename to tests/Display_-_--quiet.sh diff --git a/tests/007-ratecount b/tests/Display_-_--rate_-_displayed_value_changes.sh similarity index 100% rename from tests/007-ratecount rename to tests/Display_-_--rate_-_displayed_value_changes.sh diff --git a/tests/004-timer b/tests/Display_-_--timer_-_displayed_value_changes.sh similarity index 100% rename from tests/004-timer rename to tests/Display_-_--timer_-_displayed_value_changes.sh diff --git a/tests/000-cat b/tests/Integrity_-_Basic.sh similarity index 100% rename from tests/000-cat rename to tests/Integrity_-_Basic.sh diff --git a/tests/012-cksum b/tests/Integrity_-_Binary_data.sh similarity index 100% rename from tests/012-cksum rename to tests/Integrity_-_Binary_data.sh diff --git a/tests/016-cksumpipe b/tests/Integrity_-_From_bursty_source.sh similarity index 100% rename from tests/016-cksumpipe rename to tests/Integrity_-_From_bursty_source.sh diff --git a/tests/022-large-file b/tests/Integrity_-_Large_file_support.sh similarity index 100% rename from tests/022-large-file rename to tests/Integrity_-_Large_file_support.sh diff --git a/tests/011-pipe b/tests/Integrity_-_On_output_pipe_close.sh similarity index 100% rename from tests/011-pipe rename to tests/Integrity_-_On_output_pipe_close.sh diff --git a/tests/020-remote-cksum b/tests/Integrity_-_When_adjusted_remotely.sh similarity index 100% rename from tests/020-remote-cksum rename to tests/Integrity_-_When_adjusted_remotely.sh diff --git a/tests/001-interval b/tests/Modifiers_-_--interval.sh similarity index 100% rename from tests/001-interval rename to tests/Modifiers_-_--interval.sh diff --git a/tests/002-rate b/tests/Transfer_-_--rate-limit.sh similarity index 100% rename from tests/002-rate rename to tests/Transfer_-_--rate-limit.sh diff --git a/tests/019-remote-format b/tests/Transfer_-_--remote.sh similarity index 100% rename from tests/019-remote-format rename to tests/Transfer_-_--remote.sh diff --git a/tests/021-stop-at-size b/tests/Transfer_-_--stop-at-size.sh similarity index 100% rename from tests/021-stop-at-size rename to tests/Transfer_-_--stop-at-size.sh