1 TESTS_DEB
:= pkg-somefiles
5 DEB_FILES_COUNT
= $(shell dpkg-deb
-c pkg-somefiles.deb | wc
-l
)
7 TEST_CASES
+= test-no-filter
8 TEST_CASES
+= test-no-doc-sub
9 TEST_CASES
+= test-no-doc-all
10 TEST_CASES
+= test-no-doc-except-copyright
11 TEST_CASES
+= test-no-doc-except-copyright-subdir
12 TEST_CASES
+= test-no-doc-except-copyright-and-readme
13 TEST_CASES
+= test-include-only
14 TEST_CASES
+= test-reinclude-subdir
15 TEST_CASES
+= test-same-include-exclude
16 TEST_CASES
+= test-upgrade test-help
19 ln
-fsT pkg-somefiles pkg-somefiles
/test/share
/doc
/pkg-symlinked
22 $(RM
) pkg-somefiles
/test/share
/doc
/pkg-symlinked
24 test-case
: $(TEST_CASES
)
27 $(DPKG_PURGE
) pkg-somefiles
30 # no filter, should have all files
31 $(DPKG_INSTALL
) pkg-somefiles.deb
32 test "`$(DPKG_QUERY) -L pkg-somefiles | wc -l`" = $(DEB_FILES_COUNT
)
33 $(DPKG_PURGE
) pkg-somefiles
36 # filter out /test/share/doc/*/*; this keeps the actual
37 # /test/share/doc/pkg-somefiles dir and
38 # /test/share/doc/pkg-symlinked symlink around.
40 --path-exclude
'/test/share/doc/*/*' \
42 test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
43 test -d
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles"
44 test "`ls '$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles'`" = ""
45 test -f
"$(DPKG_INSTDIR)/test/lib/pkg-somefiles/run"
46 $(DPKG_PURGE
) pkg-somefiles
49 # filter out /test/share/doc/*
51 --path-exclude
'/test/share/doc/*' \
53 ! test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
54 ! test -d
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles"
55 test -f
"$(DPKG_INSTDIR)/test/lib/pkg-somefiles/run"
56 $(DPKG_PURGE
) pkg-somefiles
58 test-no-doc-except-copyright
:
59 # filter out /test/share/doc/*/* except copyright
61 --path-exclude
'/test/share/doc/*/*' \
62 --path-include
'/test/share/doc/*/copyright' \
64 test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
65 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/copyright"
66 ! test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/html/index.html"
67 ! test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/README"
68 test -f
"$(DPKG_INSTDIR)/test/lib/pkg-somefiles/run"
69 $(DPKG_PURGE
) pkg-somefiles
71 test-no-doc-except-copyright-subdir
:
72 # prune the entire doc dir; this triggers the special case that
73 # /test/share/doc/pkg-somefiles is matched by the exclude, but still
74 # needs to be created due to the following include
76 --path-exclude
'/test/share/doc/*' \
77 --path-include
'/test/share/doc/*/copyright' \
79 test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
80 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/copyright"
81 ! test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/html/index.html"
82 ! test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/README"
83 test -f
"$(DPKG_INSTDIR)/test/lib/pkg-somefiles/run"
84 $(DPKG_PURGE
) pkg-somefiles
86 test-no-doc-except-copyright-and-readme
:
87 # two includes which revert an exclude, second of which matches
88 # several subdirs with one *
90 --path-exclude
'/test/share/doc/*' \
91 --path-include
'/test/share/doc/*/copyright' \
92 --path-include
'/test*/READ*' \
94 test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
95 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/copyright"
96 ! test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/html/index.html"
97 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/README"
98 test -f
"$(DPKG_INSTDIR)/test/lib/pkg-somefiles/run"
99 $(DPKG_PURGE
) pkg-somefiles
102 # only includes, should be a no-op and have all files
104 --path-include
'/test/*' \
105 --path-include
'/test/share/doc' \
106 --path-include
'/test/lib/*/*' \
108 test "`$(DPKG_QUERY) -L pkg-somefiles | wc -l`" = $(DEB_FILES_COUNT
)
109 test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
110 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/copyright"
111 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/html/index.html"
112 test -f
"$(DPKG_INSTDIR)/test/lib/pkg-somefiles/run"
113 $(DPKG_PURGE
) pkg-somefiles
115 test-reinclude-subdir
:
116 # Exclude a directory tree and reinclude some of its subdirectories
118 --path-exclude
'/test/share/locale/*' \
119 --path-include
'/test/share/locale/de/*' \
121 test "`$(DPKG_QUERY) -L pkg-somefiles | wc -l`" = $(DEB_FILES_COUNT
)
122 test -d
"$(DPKG_INSTDIR)/test/share/locale/de"
123 test -f
"$(DPKG_INSTDIR)/test/share/locale/de/foo.mo"
124 ! test -f
"$(DPKG_INSTDIR)/test/share/locale/ca/foo.mo"
125 ! test -f
"$(DPKG_INSTDIR)/test/share/locale/es/foo.mo"
126 $(DPKG_PURGE
) pkg-somefiles
128 test-same-include-exclude
:
129 # include the same things than exclude, should be a no-op and have
132 --path-exclude
'/test/share/*' \
133 --path-include
'/test/share/*' \
135 test "`$(DPKG_QUERY) -L pkg-somefiles | wc -l`" = $(DEB_FILES_COUNT
)
136 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/html/index.html"
137 test -f
"$(DPKG_INSTDIR)/test/lib/pkg-somefiles/run"
138 $(DPKG_PURGE
) pkg-somefiles
142 --path-exclude
'/test/share/*' \
143 --path-include
'/test/share/*' \
144 --path-exclude
'/test/share/*' \
145 --path-include
'/test/share/*' \
147 test "`$(DPKG_QUERY) -L pkg-somefiles | wc -l`" = $(DEB_FILES_COUNT
)
148 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/html/index.html"
149 test -f
"$(DPKG_INSTDIR)/test/lib/pkg-somefiles/run"
150 $(DPKG_PURGE
) pkg-somefiles
153 # files are removed/re-added on upgrades
154 $(DPKG_INSTALL
) pkg-somefiles.deb
155 test "`$(DPKG_QUERY) -L pkg-somefiles | wc -l`" = $(DEB_FILES_COUNT
)
156 test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
157 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/copyright"
160 --path-exclude
'/test/share/doc/*' \
162 ! test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
163 ! test -d
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles"
166 --path-exclude
'/test/share/doc/*' \
167 --path-include
'/test/share/doc/*/copyright' \
169 test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
170 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/copyright"
171 ! test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/README"
173 $(DPKG_INSTALL
) pkg-somefiles.deb
174 test "`$(DPKG_QUERY) -L pkg-somefiles | wc -l`" = $(DEB_FILES_COUNT
)
175 test -L
"$(DPKG_INSTDIR)/test/share/doc/pkg-symlinked"
176 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/copyright"
177 test -f
"$(DPKG_INSTDIR)/test/share/doc/pkg-somefiles/README"
178 $(DPKG_PURGE
) pkg-somefiles
180 # --help output explains the options
182 $(DPKG
) --help | grep
-q
-- --path-include
183 $(DPKG
) --help | grep
-q
-- --path-exclude