X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=tests%2Flib;h=0b8836266fbfc1746a16a09a2d71c10205a19a06;hb=d3606ff36cbf24f80152c5848fefee0c62686486;hp=d131e7b2a8dc4a6328a32d8cb1016135a896ba58;hpb=ada48ca013e77d7e821d326db40bc1a59ba639ea;p=dgit.git diff --git a/tests/lib b/tests/lib index d131e7b2..0b883626 100644 --- a/tests/lib +++ b/tests/lib @@ -9,9 +9,12 @@ set -o pipefail t-set-intree -: ${DGIT_TEST_DEBUG:=-D} +: ${DGIT_TEST_DEBUG=-D} export DGIT_TEST_DEBUG +export GIT_COMMITTER_DATE='1440253867 +0100' +export GIT_AUTHOR_DATE='1440253867 +0100' + root=`pwd` troot=$root/tests testname="${DGIT_TEST_TESTNAME-${0##*/}}" @@ -45,6 +48,11 @@ incoming = $tmp/incoming run_dinstall = 0 END +t-git-next-date () { + GIT_COMMITTER_DATE="$(( ${GIT_COMMITTER_DATE%% *} + 1 )) ${GIT_COMMITTER_DATE#* }" + GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE" +} + t-expect-fail () { local mpat="$1"; shift @@ -126,7 +134,7 @@ t-untar () { local tarfile=$1.tar local edittree=$1.edit if test -d "$edittree"; then - cp -al "$edittree"/* . + cp -a "$edittree"/* . else tar xf "$tarfile" fi @@ -504,6 +512,28 @@ t-apply-diff () { | patch -p1 -u } +t-gbp-unapplied-pq2qc () { + # does `gbp pq export' (leaving us on BRANCH (eg "quilt-tip")) + # commits the resulting debian/patches on qc/BRANCH + # goes back to patch-queue/BRANCH + # qc/BRANCH is not fast-forwarding + + gbp pq export + + branch=`git symbolic-ref HEAD` + branch=${branch#refs/heads/} + + case "$branch" in + */*) fail "unexpected branch $branch" ;; + esac + + git branch -f qc/$branch + git checkout qc/$branch + git add debian/patches + git commit -m 'Commit patch queue' + git checkout patch-queue/$branch +} + t-commit () { local msg=$1 v=${2-1.$revision} @@ -602,6 +632,10 @@ t-restrict () { (cd $root; t-restriction-$restriction >&2) } +t-dependencies () { + : "Hopefully installed: $*" +} + t-chain-test () { local ct=$1 local d=${0%/*}