X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=test%2Fcommon.sh;h=9e6cb2269cebb0a0b7a08b55a43f102c87e22e86;hb=f7d9cd4bee03230dd8839581f772bdf2bdbf3c97;hp=d195a7cf5d24b35d81c0b6e5e18ccc06602f4473;hpb=82325c1114254a76b8285bb710b2f651674331c7;p=mmh diff --git a/test/common.sh b/test/common.sh index d195a7c..9e6cb22 100644 --- a/test/common.sh +++ b/test/common.sh @@ -8,6 +8,17 @@ trap ' ' 0 1 2 15 failed=0 +#fake sleeps 60 secounds and then reads all input +mmh_test_fakepager() +{ + sleep 60 + + while read a + do + sleep 0 + done + exit 0 +} test_skip() { @@ -52,10 +63,16 @@ require_locale() test_skip "no suitable locale available" } +# Do a best guess at FQDN +mh_hostname() +{ + hostname -f 2>/dev/null || uname -n +} + # Some stuff for doing silly progress indicators progress_update() { - test -t 1 || return 0 # supress progress meter if non-interactive + test -t 1 || return 0 # suppress progress meter if non-interactive this="$1" first="$2" last="$3" @@ -69,11 +86,17 @@ progress_update() progress_done() { - test -t 1 || return 0 # supress progress meter if non-interactive + test -t 1 || return 0 # suppress progress meter if non-interactive printf "100%%\n" } +#### Replace generated Content-ID headers with static value +replace_contentid() +{ + sed "/^Content-ID/s/:.*/: /" "$@" +} + #### Filter that squeezes blank lines, partially emulating GNU cat -s, #### but sufficient for our purpose.