chiark / gitweb /
test suite: dpkgsourceignores-docs: Check dgit-maint-merge(7) -i -I rune
[dgit.git] / tests / tests / dpkgsourceignores-docs
1 #!/bin/bash
2 set -e
3 . tests/lib
4
5 t-restriction-x-dgit-intree-only
6 # we need the .pod source, which is not shipped
7
8 cd $tmp
9
10 : ----- extract args from document -----
11
12 perl -ne '
13         BEGIN { print "\n=head1 dgit-test-title\n\n"; }
14         next unless
15                 m/^=for dgit-test dpkg-source-ignores begin/..
16                 m/^=for dgit-test dpkg-source-ignores end/;
17         next unless m/dpkg-buildpackage.*-i.*-I/;
18         s/\s*dpkg-buildpackage\s+//;
19         s/\s+-S\s*//;
20         print;
21 ' $root/dgit-maint-merge.7.pod >doc.pod
22
23 pod2text doc.pod >doc.txt
24
25 perl -ne '
26         next unless m/\S/;
27         next if m/dgit-test-title/;
28         print "for arg in ";
29         print;
30         print " do\n";
31 ' doc.txt >doc.sh
32
33 cat >>doc.sh <<'END'
34         printf "%s\n" "$arg"
35 done
36 END
37
38 chmod +x doc.sh
39 ./doc.sh >doc.args
40
41 : ----- extract args from dgit -----
42
43 perl -ne '
44         next unless m/^\s*our\s+\@dpkg_source_ignores\s*=/;
45         print;
46 ' $root/dgit >dgit.pl
47
48 cat >>dgit.pl <<'END'
49         foreach my $arg (@dpkg_source_ignores) {
50                 print $arg, "\n" or die $!;
51         }
52 END
53
54 perl dgit.pl >dgit.args
55
56 : ----- compare -----
57
58 diff -u dgit.args doc.args
59
60 t-ok