X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=t%2Ftest-lib.sh;h=75249fe32b0b0e159b4b6ad1773efa2673b2cd22;hp=1f9913e3cf9ba49b4cb76cc5b985d914cb527b69;hb=HEAD;hpb=f80453b693e6d3ce5450755310faf5e5d6e5c143 diff --git a/t/test-lib.sh b/t/test-lib.sh index 1f9913e3..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" @@ -311,7 +316,7 @@ fi fixup_dirs [[ -z "$o_executables" ]] && o_executables="para_afh para_audioc para_audiod - para_client para_fade para_filter para_gui para_recv para_server + para_client para_mixer para_filter para_gui para_recv para_server para_write" for exe in $o_executables; do export $(tr 'a-z' 'A-Z' <<< $exe)="$o_executables_dir/$exe"