summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/lib-build-modes38
-rwxr-xr-xtests/tests/build-modes-gbp1
-rwxr-xr-xtests/tests/oldnewtagalt2
-rwxr-xr-xtests/tests/push-source2
-rwxr-xr-xtests/tests/push-source-with-changes14
5 files changed, 42 insertions, 15 deletions
diff --git a/tests/lib-build-modes b/tests/lib-build-modes
index dbceb42..bc8b2aa 100644
--- a/tests/lib-build-modes
+++ b/tests/lib-build-modes
@@ -34,7 +34,9 @@ bm-prep () {
dpkgbuildpackage_deps_for_clean=false
fi
- cleanmodes_default="git none dpkg-source dpkg-source-d"
+ cleanmodes_default="git none"
+ cleanmodes_default+=" dpkg-source$cleanmodes_dpkgsource_extra"
+ cleanmodes_default+=" dpkg-source-d$cleanmodes_dpkgsource_extra"
cleanmodes_all="$cleanmodes_default git-ff check"
cleanmodes="$cleanmodes_default"
}
@@ -47,7 +49,7 @@ bm-gbp-example-acts () {
bm-prep-ownpackage-branches for-build-modes
- cleanmodes='git dpkg-source'
+ cleanmodes='git dpkg-source,no-check'
for act in "$@"; do
bm-guess-e-source-e-targets "$act"
@@ -127,17 +129,17 @@ bm-compute-expected () {
*[^\ ]*)
;;
*)
- # dgit won't bother cleaning the tree
- # if no build is going to be run
- eff_cleanmode=none
+ # if no build is going to be run, dgit will only check
+ # cleanliness rather than actually cleaning
+ eff_cleanmode=C$cleanmode
;;
esac
case "$act" in
sbuild*)
- # dgit sbuild won't bother cleaning the tree
+ # dgit sbuild will only check cleanliness
# because it doesn't need to to make a .dsc for sbuild
- eff_cleanmode=none
+ eff_cleanmode=C$cleanmode
;;
esac
@@ -148,15 +150,29 @@ bm-compute-expected () {
case $eff_cleanmode in
git) echo >&4 'BUILD-MODES PROGRAM git clean -xdf' ;;
git-ff) echo >&4 'BUILD-MODES PROGRAM git clean -xdff' ;;
- check) echo >&4 'BUILD-MODES PROGRAM git clean -xdn' ;;
- dpkg-source-d) echo >&4 "EXAMPLE RULES TARGET clean" ;;
- dpkg-source) bm-build-deps-ok || tolerate_fail=tolerate
+ check|Ccheck) echo >&4 'BUILD-MODES PROGRAM git clean -dn -x' ;;
+ dpkg-source-d|dpkg-source-d,no-check)
echo >&4 "EXAMPLE RULES TARGET clean"
;;
- none) ;;
+ dpkg-source|dpkg-source,no-check)
+ bm-build-deps-ok || tolerate_fail=tolerate
+ echo >&4 "EXAMPLE RULES TARGET clean"
+ ;;
+ none|Cnone) ;;
+ Cdpkg-source*) ;; # handled below
+ Cgit|Cgit-ff) ;;
*) fail "t-compute-expected-run $cleanmode ??" ;;
esac
+ case $eff_cleanmode in
+ dpkg-source|Cdpkg-source|dpkg-source-d|Cdpkg-source-d)
+ echo >&4 'BUILD-MODES PROGRAM git clean -dn'
+ ;;
+ dpkg-source*,no-check|Cdpkg-source*,no-check)
+ ;;
+ Cdpkg-source*) fail "t-compute-expected-run wd $cleanmode ??" ;;
+ esac
+
if [ "x$e_targets" != x ]; then
# e_targets can be " " to mean `/may/ fail due to b-d'
bm-build-deps-ok || tolerate_fail=tolerate
diff --git a/tests/tests/build-modes-gbp b/tests/tests/build-modes-gbp
index d99b791..93d0811 100755
--- a/tests/tests/build-modes-gbp
+++ b/tests/tests/build-modes-gbp
@@ -21,6 +21,7 @@ quirk-clean-fixup () {
}
bm_quirk_before_diff=quirk-clean-fixup
+cleanmodes_dpkgsource_extra=,no-check
bm-prep
for act in \
diff --git a/tests/tests/oldnewtagalt b/tests/tests/oldnewtagalt
index 098fe19..6730918 100755
--- a/tests/tests/oldnewtagalt
+++ b/tests/tests/oldnewtagalt
@@ -9,7 +9,7 @@ cd $p
test-push () {
t-commit "$1"
- t-dgit build-source
+ t-dgit -wgf build-source
t-dgit push
}
diff --git a/tests/tests/push-source b/tests/tests/push-source
index f0eafb8..79c4636 100755
--- a/tests/tests/push-source
+++ b/tests/tests/push-source
@@ -12,7 +12,7 @@ cd $p
t-refs-same-start
t-ref-head
-t-dgit --dpkg-buildpackage:-d push-source --new
+t-dgit push-source --new
t-pushed-good master
t-push-was-source-only
diff --git a/tests/tests/push-source-with-changes b/tests/tests/push-source-with-changes
index 580ea3a..aed1b63 100755
--- a/tests/tests/push-source-with-changes
+++ b/tests/tests/push-source-with-changes
@@ -13,14 +13,24 @@ t-ref-head
# (1) try pushing a changes file containing binaries
-t-dgit --dpkg-buildpackage:-d build -F
+t-dgit build -F
t-expect-push-fail 'user-specified changes file is not source-only' \
t-dgit -C ../${p}_1.0_multi.changes push-source --new
# (2) try pushing a source-only changes file
-t-dgit --dpkg-buildpackage:-d build-source
+t-expect-fail F:'tree contains uncommitted files' \
+t-dgit build-source
+
+cp debian/rules{,~}
+git clean -df
+ls debian/rules~
+
+t-expect-fail F:'tree contains uncommitted files' \
+t-dgit -wdda build-source
+
+t-dgit build-source
t-dgit -C ../${p}_1.0_source.changes push-source --new
t-pushed-good master