X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=t%2Ftest-lib.sh;h=75249fe32b0b0e159b4b6ad1773efa2673b2cd22;hp=9c6516e2abdd9500848263f324dd7afbe8246829;hb=HEAD;hpb=bd28ec9a64884d70917c4fdea1a3a70c91758f83 diff --git a/t/test-lib.sh b/t/test-lib.sh index 9c6516e2..1ba70632 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1,9 +1,8 @@ #!/bin/bash -# paraslash test suite helper functions -# Licensed under the GPL v2. For licencing details see COPYING. -# uses ideas and code from git's test-lib.sh, Copyright (c) 2005 Junio C Hamano - +# Test suite helper functions, uses ideas and code from git's test-lib.sh, +# Copyright (c) 2005 Junio C Hamano. Licensed under the GPL v2, see file +# COPYING. get_audio_file_paths() { @@ -18,9 +17,12 @@ get_audio_file_paths() say_color() { + local severity=$1 + + shift if [[ "$o_nocolor" != "true" && -n "$1" ]]; then export TERM=$ORIGINAL_TERM - case "$1" in + case "$severity" in error) tput $C_BOLD; tput $C_SETAF 1;; skip) tput $C_SETAF 5;; ok) @@ -33,8 +35,11 @@ say_color() tput $C_SETAF 6;; esac fi - shift - printf "%s\n" "$*" + if [[ "$severity" == 'error' ]]; then + printf "%s\n" "$*" 1>&2 + else + printf "%s\n" "$*" + fi if [[ "$o_nocolor" != "true" && -n "$1" ]]; then tput $C_SGR0 export TERM=dumb @@ -280,7 +285,7 @@ fixup_dirs() [[ -z "$o_trash_dir" ]] && o_trash_dir="$test_dir/trashes" [[ -z "$o_man_dir" ]] && o_man_dir="$test_dir/../build/man/man1" - # we want alsolute paths because relative paths become invalid + # we want absolute paths because relative paths become invalid # after changing to the trash dir [[ -n "${o_results_dir##/*}" ]] && o_results_dir="$wd/$o_results_dir" [[ -n "${o_executables_dir##/*}" ]] && o_executables_dir="$wd/$o_results_dir"