chiark / gitweb /
Test suite: break out t-expect-fail
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 19 Apr 2015 21:49:14 +0000 (22:49 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 May 2015 10:54:06 +0000 (11:54 +0100)
tests/lib
tests/tests/push-newpackage

index 70cda8f6fefa45d911df58f659da06192542eb0d..7a5ede52f9f96178d17f513454448ecd4a331482 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -46,6 +46,13 @@ fail () {
        exit 1
 }
 
        exit 1
 }
 
+t-expect-fail () {
+       local mpat="$1"; shift
+       LC_MESSAGES=C "$@" 2>&1 | tee $tmp/t.output
+       test ${PIPESTATUS[0]} != 0
+       egrep "$mpat" $tmp/t.output ||false
+}
+
 t-untar () {
        local tarfile=$1.tar
        local edittree=$1.edit
 t-untar () {
        local tarfile=$1.tar
        local edittree=$1.edit
index 2bfa5d5a30871cba470689348d2e9d439996d8cb..419ffd3e818c0f08f4f53e81d6df8c5414229821 100755 (executable)
@@ -8,9 +8,8 @@ cd $p
 t-refs-same-start
 t-ref-head
 
 t-refs-same-start
 t-ref-head
 
-LC_MESSAGES=C t-dgit push 2>&1 \
-       | tee /dev/stderr \
-       | grep 'package appears to be new in this suite' >/dev/null
+t-expect-fail 'package appears to be new in this suite' \
+t-dgit push
 
 t-dgit build
 
 
 t-dgit build