chiark / gitweb /
Test suite: Make t-expect-push-fail out of the remains of mustfail
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 7 Jun 2015 13:24:19 +0000 (14:24 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 10 Jun 2015 17:28:55 +0000 (18:28 +0100)
tests/lib
tests/tests/drs-push-rejects

index c91020b..f45dd0b 100644 (file)
--- a/tests/lib
+++ b/tests/lib
@@ -72,6 +72,14 @@ t-expect-fail () {
                fail "error message not found"
 }
 
+t-expect-push-fail () {
+       local mpat="$1"; shift
+       t-reporefs pre-push
+       t-expect-fail "$mpat"  "$@"
+       t-reporefs post-push
+       diff $tmp/show-refs.{pre,post}-push
+}
+
 t-reporefs () {
        local whichoutput=$1; shift
        local outputfile="$tmp/show-refs.$whichoutput"
index 13567c3..e80620d 100755 (executable)
@@ -12,13 +12,8 @@ cd $p
 
 mustfail () {
        local mpat="$1"; shift
-       t-reporefs pre-push
-
-       t-expect-fail "$mpat" \
-       git push origin "$@" 2>&1 |tee $tmp/mustfail.txt
-
-       t-reporefs post-push
-       diff $tmp/show-refs.{pre,post}-push
+       t-expect-push-fail "$mpat" \
+       git push origin "$@"
 }
 
 mustsucceed () {