146
146
Bazaar can optionally produce output in the machine-readable subunit_
147
format, so that test output can be post-processed by various tools.
147
format, so that test output can be post-processed by various tools. To
148
generate a subunit test stream::
150
$ ./bzr selftest --subunit
152
Processing such a stream can be done using a variety of tools including:
154
* The builtin ``subunit2pyunit``, ``subunit-filter``, ``subunit-ls``,
155
``subunit2junitxml`` from the subunit project.
157
* tribunal_, a GUI for showing test results.
159
* testrepository_, a tool for gathering and managing test runs.
149
161
.. _subunit: https://launchpad.net/subunit/
162
.. _tribunal: https://launchpad.net/tribunal/
168
Bazaar ships with a config file for testrepository_. This can be very
169
useful for keeping track of failing tests and doing general workflow
170
support. To run tests using testrepository::
174
To run only failing tests::
176
$ testr run --failing
178
To run only some tests, without plugins::
180
$ test run test_selftest -- --no-plugins
182
See the testrepository documentation for more details.
184
.. _testrepository: https://launchpad.net/testrepository
422
455
unless there is a good reason
458
Testing locking behaviour
459
-------------------------
461
You may want to write tests that particular objects are or aren't locked
462
during particular operations: see for example `bug 498409`__.
464
__ https://launchpad.net/bugs/498409
466
The `TestCase` base class registers hooks that record lock actions into
467
``._lock_actions`` in this format::
470
('acquired', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/branch-lockc4au55ppz8wdym11z1aq)),
471
('released', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/branch-lockc4au55ppz8wdym11z1aq)),
472
('acquired', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/repository/lockyxb3rn4sw1oyx1jzkt45)),
473
('released', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/repository/lockyxb3rn4sw1oyx1jzkt45)),
474
('acquired', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/branch/lockh8c6t28rcjdkgxtndbje)),
475
('released', LockResult(file:///tmp/testbzr-J2pcy2.tmp/.bzr/branch/lockh8c6t28rcjdkgxtndbje)),
478
Alternatively you can register your own hooks to make custom assertions:
479
see `TestCase._check_locks` for an example.
543
599
- UnicodeFilenameFeature
544
600
- FTPServerFeature
545
601
- CaseInsensitiveFilesystemFeature.
602
- chown_feature: The test can rely on OS being POSIX and python
604
- posix_permissions_feature: The test can use POSIX-style
605
user/group/other permission bits.
548
608
Defining a new feature that tests can require