summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rwxr-xr-xtests/enumerate-tests1
-rw-r--r--tests/lib8
-rw-r--r--tests/lib-restricts6
-rwxr-xr-xtests/tests/gdr-makepatches78
-rwxr-xr-xtests/tests/i18n-messages41
-rwxr-xr-xtests/tests/i18n-po4a-uptodate11
-rwxr-xr-xtests/tests/package-build14
7 files changed, 84 insertions, 5 deletions
diff --git a/tests/enumerate-tests b/tests/enumerate-tests
index 429d46d..a532b52 100755
--- a/tests/enumerate-tests
+++ b/tests/enumerate-tests
@@ -46,6 +46,7 @@ test-begin-gencontrol () {
}
restriction-gencontrol () {
+ if [ $r = x-dgit-out-of-tree-only ]; then return; fi
restrictions+=" $r"
}
diff --git a/tests/lib b/tests/lib
index 57b9e38..a050522 100644
--- a/tests/lib
+++ b/tests/lib
@@ -92,7 +92,9 @@ t-expect-fail () {
local mpat="$1"; shift
set +o pipefail
- LC_MESSAGES=C "$@" 2>&1 | tee $tmp/t.output
+ LC_MESSAGES=${expect_fail_lcmessages-C} \
+ LANGUAGE=${expect_fail_lcmessages-C} \
+ "$@" 2>&1 | tee $tmp/t.output
local ps="${PIPESTATUS[*]}"
set -o pipefail
@@ -407,8 +409,8 @@ t-git-fsck () {
t-check-only-bpd () {
if [ "$bpd" = .. ]; then return; fi
t-files-notexist \
- ../*.{deb,changes,dsc,buildinfo} \
- ../*.{tar,diff}.*
+ $tmp/*.{deb,changes,dsc,buildinfo} \
+ $tmp/*.{tar,diff}.*
}
t-fscks () {
diff --git a/tests/lib-restricts b/tests/lib-restricts
index dfaaa25..5d32288 100644
--- a/tests/lib-restricts
+++ b/tests/lib-restricts
@@ -6,6 +6,12 @@ t-restriction-x-dgit-intree-only () {
return 1
}
+t-restriction-x-dgit-out-of-tree-only () {
+ if [ "x$DGIT_TEST_INTREE" = x ]; then return 0; fi
+ echo 'running out of development tree'
+ return 1
+}
+
t-restriction-x-dgit-git-only () {
if test -d .git; then return 0; fi
echo 'not running out of git clone'
diff --git a/tests/tests/gdr-makepatches7 b/tests/tests/gdr-makepatches7
index d6a5143..9356987 100755
--- a/tests/tests/gdr-makepatches7
+++ b/tests/tests/gdr-makepatches7
@@ -27,11 +27,15 @@ t-some-changes for-dgit-fixup m
t-git-debrebase
-t-expect-fail 'dgit: failed command: test-suite-break-git-debrebase' \
-t-dgit -wgf --git-debrebase=test-suite-break-git-debrebase quilt-fixup
+t-expect-fail 'dgit: failed command: false' \
+t-dgit -wgf --git-debrebase=false quilt-fixup
+git branch before-gdr-true
t-dgit -wgf --git-debrebase=true quilt-fixup
+git reset --hard before-gdr-true
+t-dgit -wgf --git-debrebase=no-such-command-exists quilt-fixup
+
t-some-changes for-make-patches-fails-then-dgit-fixup m
t-expect-fail 'Patch export produced patch amendments' \
diff --git a/tests/tests/i18n-messages b/tests/tests/i18n-messages
new file mode 100755
index 0000000..f2aaa87
--- /dev/null
+++ b/tests/tests/i18n-messages
@@ -0,0 +1,41 @@
+#!/bin/bash
+set -e
+autoimport=
+. tests/lib
+
+t-dependencies NO-DGIT GDR
+t-restrict x-dgit-out-of-tree-only
+# We don't run this test in-tree because:
+# 1. The .mo files that we would use might need to be built
+# and would certainly have to be `installed' somewhere we
+# could reference them. We could do that here maybe,
+# but it would risk dirtying the tree because the i18n
+# machinery is dirtying, and also:
+# 2. The locale system does not provide a path-like variable
+# we could use to point to our not-yet-installed .mo files.
+# There is LOCPATH but setting it breaks everything because
+# it disables `locale archives' and those are what provides
+# important infrastructure.
+
+t-setup-import gdr-convert-gbp-noarchive
+
+cd $p
+
+t-gdr-prep-new-upstream 2.1
+git tag v2.1 upstream
+
+git branch startpoint
+v=2.1-1
+
+git checkout master
+
+anchor=$(t-git-debrebase anchor)
+
+t-expect-fail F:'old anchor is recognised' \
+t-git-debrebase --anchor=$anchor new-upstream 2.1
+
+expect_fail_lcmessages=en_US.UTF-8
+t-expect-fail F:'old anchor is recognized' \
+t-git-debrebase --anchor=$anchor new-upstream 2.1
+
+t-ok
diff --git a/tests/tests/i18n-po4a-uptodate b/tests/tests/i18n-po4a-uptodate
new file mode 100755
index 0000000..98aa69a
--- /dev/null
+++ b/tests/tests/i18n-po4a-uptodate
@@ -0,0 +1,11 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-restrict x-dgit-git-only
+
+cd $root
+
+make -C po4a po4a.cfg.check
+
+t-ok
diff --git a/tests/tests/package-build b/tests/tests/package-build
new file mode 100755
index 0000000..0b87823
--- /dev/null
+++ b/tests/tests/package-build
@@ -0,0 +1,14 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-restrict x-dgit-git-only
+
+mkdir $tmp/dgit
+cd $root
+git ls-files -z |xargs -0 cp --parents -t $tmp/dgit
+cd $tmp/dgit
+
+dpkg-buildpackage -nc -uc -b
+
+echo ok.