Skip to content

Commit

Permalink
Improve TEST documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlouis committed Feb 11, 2011
1 parent f150d46 commit ec9cbe2
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ especially if the client behaves badly.

## Testing etorrent

Read the document [etorrent/TEST.md](/jlouis/etorrent/TEST.md)
Read the document [etorrent/TEST.md](/jlouis/etorrent/tree/master/TEST.md)
for how to run tests of the system.

## Troubleshooting
Expand Down
57 changes: 51 additions & 6 deletions TEST.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,55 @@
# How to run unit tests

Loose list of things to remember to document:
## Prerequisites

To run the unit tests, you currently need a set of programs installed:

* [OpenTracker](http://erdgeist.org/arts/software/opentracker/) -
Needed for tracker operations. If you can provide an Erlang-based
tracker, so much the better!
* [QuickCheck Mini](http://www.quviq.com/news100621.html) - The small
version of QuviQ's QuickCheck tool. It should be somewhere in your
Erlang path.

## Performing tests

To perform all tests, run

make distclean test

There are some important targets you can use for test cases. Note that
dependency management could be improved, so you will have to run these
manually for now:

* `distclean` - We always run tests from the *release* in *rel* so
when you do changes, you will have to rebuild the release in
rel. The easiest way is to distclean everything and then have the
`test` target build the release as a dependency.

* `testclean` - The test system creates a number of files for testing
purposes the first time it is run. This target removes these and is
necessary if you alter the generated data already on disk.

## What tests are performed?

### EUnit

Internal tests are done with EUnit inside the modules of the etorrent
source code proper (underneath an IFDEF shield). There are both
"normal" unit tests and QuickCheck tests in there and both are run if
you execute `make eunit`.

### Common Test

Common Test is our external test framework. It uses the release build
to perform a series of does-it-work tests by trying to run the code
and requiring correctness of the tested files. Currently performed
tests:

* Start a tracker and two instances of etorrent. Seed from one
instance to the other instance to make sure we can transfer files.

Output from Common Test are in the top-level directory `logs` by
default. Point your browser to `logs/index.html`.

* Tell people how to install opentracker
(plead for a tracker in Erlang :)
* Document that we use a release for it.
* Document how to interpret and read the results.
* Document how the system configures itself.

0 comments on commit ec9cbe2

Please sign in to comment.