From: Ian Jackson Date: Sun, 7 Jun 2015 13:24:19 +0000 (+0100) Subject: Test suite: Make t-expect-push-fail out of the remains of mustfail X-Git-Tag: debian/0.30~97 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=f97a00d63b1d302cb23c5ffb090efea80fd8d42f;hp=5d8e32854c1d89e337bc606d423634a667f9b0ff;ds=sidebyside Test suite: Make t-expect-push-fail out of the remains of mustfail --- diff --git a/tests/lib b/tests/lib index c91020bc..f45dd0b2 100644 --- 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" diff --git a/tests/tests/drs-push-rejects b/tests/tests/drs-push-rejects index 13567c3f..e80620da 100755 --- a/tests/tests/drs-push-rejects +++ b/tests/tests/drs-push-rejects @@ -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 () {