summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2017-08-03 09:53:58 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2017-08-04 23:06:19 +0100
commit3e0e30a2fab1b5770c770bbc4df3d55bef611d20 (patch)
tree83256fd7c7e76ec41ee732cd0a94ef80d4fed07b /tests
parentff23ba1247e0c44574139fed95253b6ae5641569 (diff)
test suite: dpkgsourceignores-docs: Check dgit-maint-merge(7) -i -I rune
Check that the rune we document is the same as dgit actually uses. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/tests/dpkgsourceignores-docs60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/tests/dpkgsourceignores-docs b/tests/tests/dpkgsourceignores-docs
new file mode 100755
index 0000000..397b783
--- /dev/null
+++ b/tests/tests/dpkgsourceignores-docs
@@ -0,0 +1,60 @@
+#!/bin/bash
+set -e
+. tests/lib
+
+t-restriction-x-dgit-intree-only
+# we need the .pod source, which is not shipped
+
+cd $tmp
+
+: ----- extract args from document -----
+
+perl -ne '
+ BEGIN { print "\n=head1 dgit-test-title\n\n"; }
+ next unless
+ m/^=for dgit-test dpkg-source-ignores begin/..
+ m/^=for dgit-test dpkg-source-ignores end/;
+ next unless m/dpkg-buildpackage.*-i.*-I/;
+ s/\s*dpkg-buildpackage\s+//;
+ s/\s+-S\s*//;
+ print;
+' $root/dgit-maint-merge.7.pod >doc.pod
+
+pod2text doc.pod >doc.txt
+
+perl -ne '
+ next unless m/\S/;
+ next if m/dgit-test-title/;
+ print "for arg in ";
+ print;
+ print " do\n";
+' doc.txt >doc.sh
+
+cat >>doc.sh <<'END'
+ printf "%s\n" "$arg"
+done
+END
+
+chmod +x doc.sh
+./doc.sh >doc.args
+
+: ----- extract args from dgit -----
+
+perl -ne '
+ next unless m/^\s*our\s+\@dpkg_source_ignores\s*=/;
+ print;
+' $root/dgit >dgit.pl
+
+cat >>dgit.pl <<'END'
+ foreach my $arg (@dpkg_source_ignores) {
+ print $arg, "\n" or die $!;
+ }
+END
+
+perl dgit.pl >dgit.args
+
+: ----- compare -----
+
+diff -u dgit.args doc.args
+
+t-ok