README.source 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. Source layout
  2. =============
  3. The source tree for ``reportbug`` is organised this way:
  4. * Top level
  5. * Manual pages.
  6. * Debian packaging
  7. * ``debian/`` contains the control files used to build the Debian
  8. source and binary packages.
  9. * Programs
  10. * ``bin/`` contains the end-user programs (e.g. ``reportbug``,
  11. ``querybts``).
  12. * Libraries
  13. * ``reportbug/`` contains the Python library module package used by
  14. the programs.
  15. * `Unit testing framework`_
  16. * ``test/`` contains the unit test suite. Unit test modules are
  17. discovered and run using the ``nosetests`` program, and are named
  18. as ``test_*.py``.
  19. * Internal checking framework
  20. * ``checks/`` contains various scripts that ensure reportbug's
  21. internals are up-to-date with the Debian BTS.
  22. * Internationalisation and localisation
  23. * ``po4a/`` contains configuration and data for localisation of
  24. source files using the ``po4a`` tool.
  25. Unit testing framework
  26. ======================
  27. The reportbug source package now has a unit testing framework.
  28. The directory ``test/`` contains unit test modules and supporting
  29. files. New unit test modules should be added to this directory and
  30. named ``test_*.py``.
  31. The unit test suite depends on the `python-nose` package being
  32. installed, to make the ``nosetests`` command available. The unit tests
  33. themselves can be written using either the `unittest` or `doctest`
  34. modules in the standard Python library.
  35. The `scaffold` module (from the ``test/scaffold.py`` file) contains
  36. some helper functionality for unit tests, including an extended
  37. `TestCase` class.
  38. ``make`` targets for testing and quality checks
  39. -----------------------------------------------
  40. The following ``make`` targets are useful for testing and related
  41. tasks.
  42. * ``make test`` runs the unit test suite, preceded by a timestamp
  43. banner, and reports any test failures or "OK" if all tests pass.
  44. * ``make test-continuous`` starts a loop which clears the screen, runs
  45. ``make test``, then waits for any of the tests or source code to
  46. change, and starts the loop again.
  47. This is useful to run in a separate terminal during a development
  48. session, so that whenever a change is made the test suite will be
  49. run automatically. You might want to keep the window hidden while
  50. actually editing files, and only look at it when you've created or
  51. modified a file and want to check its effect on the test run.
  52. This uses the ``inotifywait`` command from the `inotify-tools`
  53. package to wait for `create` and `modify` events.
  54. * ``make coverage`` runs the test suite and collects test coverage
  55. information, then reports the current statement coverage of the test
  56. suite.
  57. This requires the `python-coverage` package to be installed. See its
  58. documentation for more about its operation.
  59. * ``make pyflakes`` runs the `pyflakes` static code checker on all
  60. Python files found in the project tree.
  61. This requires the `pyflakes` package to be installed. See its
  62. documentation for more about its operation.
  63. * ``make pylint`` runs the `pylint` code checker on all code modules
  64. and programs.
  65. This requires the `pylint` package to be installed. See its
  66. documentation for more about its operation.
  67. ..
  68. Local Variables:
  69. coding: utf-8
  70. mode: rst
  71. End:
  72. vim: filetype=rst :