fix tests for atty and document some other tests
Ximin Luo
4 years ago
188 | 188 | Testing |
189 | 189 | ------- |
190 | 190 | |
191 | For now, testsuites aren't executed for library. | |
192 | However, for binary, it is strongly recommended to run the testsuites. | |
193 | See ripgrep as example. | |
191 | Debian has two types of tests: | |
192 | ||
193 | 1. pre-install tests run in debian/rules | |
194 | 2. post-install tests defined in debian/tests/control | |
195 | ||
196 | For Debian rust packages, in (1) we run the crate's test suite with default | |
197 | features but only if there are no dev-dependencies, and in (2) we run the whole | |
198 | test suite with each feature enabled separately plus --no-default-features and | |
199 | --all-features. | |
200 | ||
201 | Sometimes, tests require extra tweaks and settings to work. In this case, you | |
202 | can tweak ``debian/rules`` for (1), and for (2) you will simply have to mark | |
203 | the relevant tests as broken using ``test_is_broken = true``. See the existing | |
204 | crate configs for examples. | |
205 | ||
206 | Other times, the tests are simply broken or can't be run in Debian. In this | |
207 | case you should disable the test in (1) by running ``dh_auto_test -- build`` | |
208 | instead of the default ``dh_auto_test -- test --all``, and for (2) again you | |
209 | should mark the relevant tests as broken. | |
210 | ||
211 | Please note that ``[packages.lib]\ntest_is_broken = true`` will transitively | |
212 | disable tests for all combinations of features. Sometimes this is correct e.g. | |
213 | if the test actually breaks for all features. Sometimes this is *not* correct, | |
214 | e.g. if the test only breaks for ``--no-default-features``. In the latter case | |
215 | you should instead patch the crate to ignore those tests when the relevant | |
216 | features are absent - see commit 457f5d76 for an example. | |
194 | 217 | |
195 | 218 | Binary-crate has "required-features" |
196 | 219 | ------------------------------------ |
0 | rust-atty (0.2.13-1) UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; urgency=medium | |
1 | ||
2 | * Team upload. | |
3 | * Package atty 0.2.13 from crates.io using debcargo 2.4.2 | |
4 | ||
5 | -- Ximin Luo <infinity0@debian.org> Fri, 17 Jan 2020 00:33:09 +0000 | |
6 | ||
0 | 7 | rust-atty (0.2.13-1) unstable; urgency=medium |
1 | 8 | |
2 | 9 | * Team upload. |
20 | 20 | |
21 | 21 | Files: debian/* |
22 | 22 | Copyright: |
23 | 2018-2019 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> | |
24 | 2018-2019 Sylvestre Ledru <sylvestre@debian.org> | |
23 | 2018-2020 Debian Rust Maintainers <pkg-rust-maintainers@alioth-lists.debian.net> | |
24 | 2018-2020 Sylvestre Ledru <sylvestre@debian.org> | |
25 | 25 | License: MIT |
26 | 26 | |
27 | 27 | License: MIT |
0 | 0 | overlay = "." |
1 | 1 | uploaders = ["Sylvestre Ledru <sylvestre@debian.org>"] |
2 | 2 | |
3 | # https://github.com/softprops/atty/issues/39 | |
4 | [packages.lib] | |
5 | test_is_broken = true | |
3 | [source] | |
4 | build_depends = ["bsdutils <!nocheck>"] |
0 | #!/usr/bin/make -f | |
1 | %: | |
2 | dh $@ --buildsystem cargo | |
3 | ||
4 | override_dh_auto_test: | |
5 | script -c 'dh_auto_test -- test --all' /dev/null |
0 | #!/usr/bin/make -f | |
1 | %: | |
2 | dh $@ --buildsystem cargo | |
3 | ||
4 | override_dh_auto_test: | |
5 | dh_auto_test -- test --all |
2 | 2 | |
3 | 3 | [source] |
4 | 4 | # xvfb, xauth needed for tests in X |
5 | build_depends = ["xvfb", "xauth"] | |
5 | build_depends = ["xvfb <!nocheck>", "xauth <!nocheck>"] |
1 | 1 | uploaders = ["kpcyrd <git@rxv.cc>"] |
2 | 2 | |
3 | 3 | [packages.lib] |
4 | # this crate is meant for wasm32-* targets, so tests are expected to not even compile. | |
5 | # we could install libstd-rust-dev-wasm32-cross and pass --target wasm32-unknown-unknown, | |
6 | # however cargo doesn't support cross-compiling doctests yet https://github.com/rust-lang/cargo/issues/4471 | |
4 | 7 | test_is_broken = true |