summaryrefslogtreecommitdiff
path: root/tests/lib
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-06-10 18:11:24 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-06-10 18:11:24 +0100
commit609f108165197b1d7a55a4908a321bad40a86442 (patch)
tree576f67f8da6978a9d0990d6ab010bd855805098d /tests/lib
parent9f377842120dd8d6206a3f3f2eb297b3e4907fa8 (diff)
Test suite: Make t-expect-fail flexible wrt which grep to run
Change the default to fgrep, and override it in the places where this is needed. Also use shell substitution to quote .s in tag name in debpolicy-newreject.
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/lib b/tests/lib
index 776e2a3..332bef2 100644
--- a/tests/lib
+++ b/tests/lib
@@ -44,12 +44,25 @@ END
t-expect-fail () {
local mpat="$1"; shift
+
+ local grepper=fgrep
+ case "$mpat" in
+ [A-Z]:*)
+ case "$mpat" in
+ E:*) grepper=egrep ;;
+ F:*) grepper=fgrep ;;
+ *) fail "bad mpat prefix in $mpat";;
+ esac
+ mpat=${mpat#[A-Z]:}
+ ;;
+ esac
+
set +o pipefail
LC_MESSAGES=C "$@" 2>&1 | tee $tmp/t.output
local gotstatus=${PIPESTATUS[0]}
set -o pipefail
test $gotstatus != 0
- egrep "$mpat" $tmp/t.output ||false
+ $grepper -e "$mpat" $tmp/t.output ||false
}
t-reporefs () {