#!/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()
{
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)
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
[[ -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"