From e079e1ff7f807be20888cd4cf8ca527f3e7ab6a0 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 25 Aug 2018 17:21:37 +0100 Subject: test suite: dch: Always use tstunt/debchange We are going to make this more sophisticated, so use it everywhere to avoid duplication. We need to soup up tstunt/debchange so that it does not depend on DGIT_TEST_REAL_DEBCHANGE. If it hasn't been put on the PATH by t-tstunt, that isn't set, and we can just run debchange from PATH. This makes faketime a test dependency for all the tests which don't have NO-DEFAULT. Signed-off-by: Ian Jackson --- debian/tests/control | 30 +++++++++++++++--------------- tests/enumerate-tests | 6 +++--- tests/lib | 5 +++-- tests/tstunt/debchange | 2 +- 4 files changed, 22 insertions(+), 21 deletions(-) diff --git a/debian/tests/control b/debian/tests/control index 33b01ac..bb06093 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,36 +1,36 @@ Tests: build-modes-gbp Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, git-buildpackage +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, git-buildpackage Tests: clone-reprepro downstream-gitless Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, reprepro +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, reprepro Tests: dpkgsourceignores-docs Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime Restrictions: x-dgit-intree-only Tests: defdistro-dsd-clone-drs dsd-clone-drs Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime Restrictions: x-dgit-intree-only x-dgit-git-only Tests: gdr-merge-conflicts Tests-Directory: tests/tests -Depends: chiark-utils-bin, git-debrebase, git-buildpackage, faketime, quilt +Depends: chiark-utils-bin, faketime, git-debrebase, git-buildpackage, quilt Tests: gdr-diverge-nmu gdr-diverge-nmu-dgit gdr-edits gdr-fresh gdr-import-dgit gdr-import-dgitview gdr-import-nostitch gdr-makepatches7 gdr-merge gdr-subcommands gdr-unprocessable gdr-unprocessable-hints Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, git-debrebase, git-buildpackage, faketime +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, git-debrebase, git-buildpackage Tests: gdr-newupstream gdr-viagit Tests-Directory: tests/tests -Depends: chiark-utils-bin, git-debrebase, git-buildpackage, faketime +Depends: chiark-utils-bin, faketime, git-debrebase, git-buildpackage Tests: gitattributes Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, bsdgames, man-db, git-man +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, bsdgames, man-db, git-man Tests: hint-testsuite-triggers Tests-Directory: tests/tests @@ -39,25 +39,25 @@ Restrictions: hint-testsuite-triggers Tests: manpages-format Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, man-db, make, groff, git-debrebase +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, man-db, make, groff, git-debrebase Tests: defdistro-mirror mirror mirror-debnewgit mirror-private Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, rsync +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, rsync Tests: build-modes-sbuild quilt-gbp-build-modes-sbuild Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, sbuild +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, sbuild Restrictions: x-dgit-schroot-build Tests: sbuild-gitish Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, sbuild, man-db +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, sbuild, man-db Restrictions: x-dgit-schroot-build Tests: spelling Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime Restrictions: x-dgit-git-only Tests: test-list-uptodate @@ -66,9 +66,9 @@ Depends: git Tests: trustingpolicy-replay Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, dput-ng +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime, dput-ng Tests: absurd-gitapply badcommit-rewrite build-modes checkout clone-clogsigpipe clone-gitnosuite clone-nogit debpolicy-dbretry debpolicy-newreject debpolicy-quilt-gbp defdistro-rpush defdistro-setup distropatches-reject dpkgsourceignores-correct drs-clone-nogit drs-push-masterupdate drs-push-rejects dsd-clone-nogit dsd-divert fetch-localgitonly fetch-somegit-notlast gbp-orig gitconfig gitworktree import-dsc import-maintmangle import-native import-nonnative import-tarbomb inarchivecopy mismatches-contents mismatches-dscchanges multisuite newtag-clone-nogit oldnewtagalt oldtag-clone-nogit orig-include-exclude orig-include-exclude-chkquery overwrite-chkclog overwrite-junk overwrite-splitbrains overwrite-version pbuilder protocol-compat push-buildproductsdir push-newpackage push-newrepeat push-nextdgit push-source push-source-with-changes quilt quilt-gbp quilt-gbp-build-modes quilt-singlepatch quilt-splitbrains quilt-useremail rpush sourceonlypolicy tag-updates unrepresentable version-opt Tests-Directory: tests/tests -Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc +Depends: dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime diff --git a/tests/enumerate-tests b/tests/enumerate-tests index 0f37c96..429d46d 100755 --- a/tests/enumerate-tests +++ b/tests/enumerate-tests @@ -42,7 +42,7 @@ finish- () { test-begin-gencontrol () { restrictions='' - dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc' + dependencies='dgit, dgit-infrastructure, devscripts, debhelper (>=8), fakeroot, build-essential, chiark-utils-bin, bc, faketime' } restriction-gencontrol () { @@ -58,10 +58,10 @@ gencontrol-add-deps () { dependencies-gencontrol () { for dep in "$deps"; do case "$dep" in - NO-DGIT) dependencies='chiark-utils-bin' ;; + NO-DGIT) dependencies='chiark-utils-bin, faketime' ;; NO-DEFAULT) dependencies='' ;; GDR) gencontrol-add-deps \ - git-debrebase git-buildpackage faketime + git-debrebase git-buildpackage ;; *) gencontrol-add-deps "$dep" ;; esac diff --git a/tests/lib b/tests/lib index 24ccf7e..376585c 100644 --- a/tests/lib +++ b/tests/lib @@ -1041,7 +1041,8 @@ t-merge-conflicted-stripping-conflict-markers () { t-commit () { local msg=$1 v=${2:-${majorv:-1}.$revision} - dch --force-distribution -v$v --distribution ${3:-unstable} "$1" + $troot/tstunt/debchange \ + --force-distribution -v$v --distribution ${3:-unstable} "$1" git add debian/changelog debcommit revision=$(( ${revision-0} + 1 )) @@ -1058,7 +1059,7 @@ t-dch-commit-r () { } t-dch-commit () { - faketime @"${GIT_AUTHOR_DATE% *}" dch "$@" + $troot/tstunt/debchange "$@" git commit -m "dch $*" debian/changelog } diff --git a/tests/tstunt/debchange b/tests/tstunt/debchange index 8c81823..f98e7fe 100755 --- a/tests/tstunt/debchange +++ b/tests/tstunt/debchange @@ -1,4 +1,4 @@ #!/bin/sh set -x faketime @"${GIT_AUTHOR_DATE% *}" \ -"$DGIT_TEST_REAL_DEBCHANGE" "$@" +"${DGIT_TEST_REAL_DEBCHANGE-debchange}" "$@" -- cgit v1.2.3