=======================
Running trash-cli tests
=======================

This documents explain how to run trash-cli tests.

For historical reason trash-cli features two test-suites written with two 
different technologies:
 - tests written for python nose
 - tests written with bashunit

Running nose tests
------------------
These will test the methods and functions and optionally the trash-cli scripts
as a whole entity. To run the tests just do::

 $ python setup.py develop -s scripts
 $ python setup.py test
 ......................................................
 ----------------------------------------------------------------------
 Ran 54 tests in 1.250s

 OK

The scripts are tested only if they were found in the `scripts` sub directory,
otherwise they are skipped. For example if you miss to supply the "-s scripts" 
option the scripts tests will be skipped:

 $ python setup.py develop
 $ python setup.py test
 ...
 $ trash-list --help ... SKIP: Script not found: /home/andrea/src/trash-cli/scripts/trash-list
 Please run 'python setup.py develop -s scripts' before.
 $ trash-put . other_argument ... SKIP: Script not found: /home/andrea/src/trash-cli/scripts/trash-list
 Please run 'python setup.py develop -s scripts' before.
 ...

Running bashunit tests
----------------------
The commands tests are executed invoking `run-test` command from the 
`command-test` directory. Refer to the `run-test` usage message for a more 
complete description.

If you are in the sudoers file you can run the test in the simplest form with:

  $ python setup.py develop --script-dir scripts/
  $ cd command-test
  $ ./create-test-volume
  [sudo] password for andrea: *********
  $ ./run-tests ../scripts test-volume
  ...
  #
  # Test report
  #
  tests passed: 132
  tests failed: 0
  tests total:  132
  success rate: 100%

-EOF
