chiark / gitweb /
test suite: tagupl: test one bad tag
[dgit.git] / tests / tests / tagupl
index 27dd973d7c0259911c01e930278429e16c99d1c3..c45f5e927d81086e87d79f9f6fdfab36796840e8 100755 (executable)
@@ -12,7 +12,11 @@ t-worktree 1.0
 
 v=1.0-1
 
+t-tagupl-settings
+
 cd $p
+git checkout -b native 
+
 git checkout --orphan upstream quilt-tip-2
 git rm -rf debian
 git commit -m 'pseudo-upstream'
@@ -20,36 +24,45 @@ git tag upstream/1.0
 
 git checkout -B master quilt-tip-2
 
-#git-deborig
-#t-dgit --quilt=gbp --dgit-view-save=split.b1 push-source --new --overwrite
-#xxx
-
 upstream=$(git rev-parse upstream/1.0~0)
 tagname=test-dummy/$v
 
-${DGIT_DEBPUSH_TEST-git debpush} \
-       --distro=test-dummy --quilt=gbp --no-push -u Senatus
+t-tagupl-test --no-push --quilt=gbp
 
 # xxx test pushing
 
-cd ..
-mkdir tagupl
-cd tagupl
-
-export DGIT_DRS_EMAIL_NOREPLY=noreply@example.org
-export DGIT_DRS_SENDMAIL=$troot/tstunt/sendmail
-export DGIT_DRS_DGIT=$troot/tstunt/dgit
-t-chain-test-somehow
-
-DGIT_DRS_ANY_URL=1 \
-DGIT_DRS_MODE="tag2upload $tmp/$p $tagname" \
- $troot/drs-git-ext 
-
 # todo: test each miss/rejection
 
-cd $tmp/$p
+ident=ok
+
+git cat-file tag $tagname >../basetag
+v=1.0-2
+tagname=test-dummy/$v
 
-t-dgit fetch
-t-pushed-good master
+perl -i -ne '
+       next if $.==1../^$/;
+       next if m/^----/..0;
+       s/\b1\.0-1\b/1.0-2/g;
+       print or die $!;
+' ../basetag
+
+with-mangled () {
+       local perl=$1
+       perl <../basetag >../badtag-$ident -pe "$perl"
+       git tag -u Senatus -f -s -m "$(cat ../badtag-$ident)" "$tagname"
+
+       t-tagupl-run-drs
+}
+
+expect-quit () {
+       mv ../tagupl/overall.log ../tagupl/overall.log-$ident
+       ident=$1
+       local perl=$2
+       local mstring=$3
+       with-mangled "$perl"
+       grep ": $mstring" ../tagupl/overall.log
+}
+
+expect-quit noplease s/please-upload/plunk/ 'tag missing please-upload'
 
 t-ok