summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2015-04-19 22:49:14 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2015-05-31 11:54:06 +0100
commitbb53fd896dbd2e5d09c56d01b5e0337b865c043d (patch)
treeb620850350e41536e20c8fdc6a4b7bf1b272534c /tests
parent323e5e59ee548bf44cc2cb9a584cb1c3edcabe3f (diff)
Test suite: break out t-expect-fail
Diffstat (limited to 'tests')
-rw-r--r--tests/lib7
-rwxr-xr-xtests/tests/push-newpackage5
2 files changed, 9 insertions, 3 deletions
diff --git a/tests/lib b/tests/lib
index 70cda8f..7a5ede5 100644
--- a/tests/lib
+++ b/tests/lib
@@ -46,6 +46,13 @@ fail () {
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
diff --git a/tests/tests/push-newpackage b/tests/tests/push-newpackage
index 2bfa5d5..419ffd3 100755
--- a/tests/tests/push-newpackage
+++ b/tests/tests/push-newpackage
@@ -8,9 +8,8 @@ cd $p
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