X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=tests%2Flib-build-modes;h=30fbb5a9a4f792e660493489ba2ca3f7f057abf6;hp=4b0f944f7c2f595b64dbdb2104c46600e8e678fe;hb=00be23b629b1a1dd04cfa1c9d10a778d30d904b6;hpb=e0f2481785baebd56a8082c9353071ae83c11922 diff --git a/tests/lib-build-modes b/tests/lib-build-modes index 4b0f944f..30fbb5a9 100644 --- a/tests/lib-build-modes +++ b/tests/lib-build-modes @@ -97,11 +97,12 @@ bm-quirk-sbuild-after-act () { fi } -bm-report-source () { +bm-report-test () { + local desc=$1; shift if "$@"; then - echo >&4 "SOURCE EXISTS" + echo >&4 "$desc EXISTS" else - echo >&4 "SOURCE MISSING" + echo >&4 "$desc MISSING" fi } @@ -141,7 +142,9 @@ bm-compute-expected () { echo >&4 "EXAMPLE RULES TARGET $t" done - bm-report-source $e_source + bm-report-test "SOURCE FILE" $e_source + bm-report-test "SOURCE IN CHANGES" $e_source + bm-report-test "DEBS IN CHANGES" expr "$e_targets" : '.*binary.*' exec 4>&- } @@ -152,6 +155,8 @@ bm-run-one () { bmid="$act,$cleanmode,$branch" bmid=${bmid// /_} + rm -f ../${p}_{v}_*.changes + heading="===== [$bmid] dgit $args =====" bmlog=$tmp/run.$bmid.output @@ -191,7 +196,20 @@ bm-run-one () { egrep >&4 '^EXAMPLE RULES TARGET|^BUILD-MODES' $bmlog || [ $? = 1 ] - bm-report-source [ -e $dsc ] + bm-report-test "SOURCE FILE" [ -e $dsc ] + + if [ $actual_status = success ]; then + local changes=$(echo ../example_${v}_*.changes) + case "$changes" in + *' '*) fail "build generated ambiguous .changes: $changes" ;; + esac + + perl -ne 'print if m/^files:/i ... m/^\S/' \ + <$changes >$changes.files + + bm-report-test "SOURCE IN CHANGES" grep '\.dsc$' $changes.files + bm-report-test "DEBS IN CHANGES" grep '\.deb$' $changes.files + fi exec 4>&-