~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to HACKING

'bzr selftest' now shows a progress bar with the number of tests, and 
progress made. 'make check' shows tests in -v mode, to be more useful
for the PQM status window. (Robert Collins).

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
    may not catch every case but it's still useful sometimes.
195
195
 
196
196
 
197
 
Factories
198
 
---------
199
 
 
200
 
In some places we have variables which point to callables that construct
201
 
new instances.  That is to say, they can be used a lot like class objects,
202
 
but they shouldn't be *named* like classes:
203
 
 
204
 
> I think that things named FooBar should create instances of FooBar when
205
 
> called. Its plain confusing for them to do otherwise. When we have
206
 
> something that is going to be used as a class - that is, checked for via
207
 
> isinstance or other such idioms, them I would call it foo_class, so that
208
 
> it is clear that a callable is not sufficient. If it is only used as a
209
 
> factory, then yes, foo_factory is what I would use.
210
 
 
211
 
 
212
197
Writing output
213
198
==============
214
199
 
282
267
    command changes it name or signature. Ideally only the tests for a
283
268
    given command are affected when a given command is changed.
284
269
 
285
 
Doctests
286
 
--------
287
 
 
288
 
We make selective use of doctests__.  In general they should provide 
289
 
*examples* within the API documentation which can incidentally be tested.  We 
290
 
don't try to test every important case using doctests -- regular Python
291
 
tests are generally a better solution.
292
 
 
293
 
Most of these are in ``bzrlib/doc/api``.  More additions are welcome.
294
 
 
295
 
  __ http://docs.python.org/lib/module-doctest.html
296
 
 
297
 
 
298
270
Running tests
299
271
=============
300
272
Currently, bzr selftest is used to invoke tests.
303
275
 
304
276
  ./bzr selftest -v blackbox
305
277
 
306
 
To skip a particular test (or set of tests), you need to use a negative
307
 
match, like so::
308
 
  ./bzr selftest '^(?!.*blackbox)'  
309
 
 
310
278
 
311
279
Errors and exceptions
312
280
=====================
419
387
so, please reply and say so.)
420
388
 
421
389
 
422
 
:: vim: ft=rst tw=74 ai
 
390
:: vim:tw=74:ai