diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-31 09:13:55 +0100 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2018-07-31 09:14:25 +0100 |
commit | fd60a31ac3b7308570eee56f1e3c8e5ef0ffafe1 (patch) | |
tree | fcaefd2d2c4c1a1642d832863effbf1246b9d9d9 /tests/tests/gdr-unprocessable | |
parent | 76a26a1e620f173b11a16e54ad424ed20f9bc116 (diff) |
test suite: gdr-unprocessable: new test
Test git-debrebase messages about unprocessable commits.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests/tests/gdr-unprocessable')
-rwxr-xr-x | tests/tests/gdr-unprocessable | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/tests/gdr-unprocessable b/tests/tests/gdr-unprocessable new file mode 100755 index 0000000..caa5321 --- /dev/null +++ b/tests/tests/gdr-unprocessable @@ -0,0 +1,60 @@ +#!/bin/bash +set -e +. tests/lib + +t-dependencies GDR + +t-setup-import gdr-convert-gbp + +cd $p + +t-dgit setup-mergechangelogs + +subcmd () { + cmd=("$@") + + branch merge 'complex merge' + branch origin 'origin commit' +} + +branch () { + branch=$1 + git checkout gdr-unprocessable/$branch + msgcore=$2 + expected-$expected +} + +cmd () { + t-git-debrebase "${cmd[@]}" +} + +expected- () { + t-expect-fail E:"$(printf "$mfmt" "$msgcore")" \ + cmd +} + +expected-ok () { + f=../out.$branch."${cmd/[^-a-zA-Z//_}" + cmd | tee $f + for mfmt in "${mfmts[@]}"; do + grep "$(printf "$mfmt" "$msgcore")" $f + done +} + +mfmt='found unprocessable commit.*%s' +subcmd +subcmd quick +subcmd new-upstream 2.0 upstream/2.0 +subcmd make-patches +subcmd breakwater +subcmd anchor + +expected=ok +mfmts=(' Unprocessable (%s)') +subcmd analyse + +mfmts=('branch not in git-debrebase form' + 'found unprocessable commit, cannot cope: %s') +subcmd status + +t-ok |