tests: update gadget zero readme docs for actually running

Fixes Github issue #652
This commit is contained in:
Karl Palsson 2016-08-18 23:34:35 +00:00 committed by GitHub
parent 99a79c7a53
commit cdd2054fe4
1 changed files with 24 additions and 5 deletions

View File

@ -6,10 +6,17 @@ The firmware itself is meant to be portable to any supported hardware, and then
identical unit test code is run against all platforms. This project can and
should be built for multiple devices.
Requirements:
pyusb for running the tests.
openocd >= 0.9 for automated flashing of specific boards
python3 for running the tests at the command line.
## Requirements:
* [pyusb](https://walac.github.io/pyusb/) for running the tests.
* [openocd](http://openocd.org/) >= 0.9 for automated flashing of specific boards
* python3 for running the tests at the command line.
### Example using virtual environments
```
pyvenv .env # ensures a python3 virtual env
. .env/bin/activate
pip install pyusb
```
You _will_ need to modify the openocd config files, as they contain specific
serial numbers of programming hardware. You should set these up for the set of
@ -18,6 +25,18 @@ available boards at your disposal.
Tests marked as @unittest.skip are either for functionality that is known to be
broken, and are awaiting code fixes, or are long running performance tests
An example of a successful test run:
## Running the tests
Below is an example of running the full suite of tests from the command line.
```
$ python -m unittest
.........ss..............
----------------------------------------------------------------------
Ran 25 tests in 0.381s
OK (skipped=2)
```
You can also run individual tests, or individual sets of tests, see the [unittest documentation](https://docs.python.org/3/library/unittest.html) for more information.
Many development environments, such as [PyCharm](https://www.jetbrains.com/pycharm/) can
also be used to edit and run the tests, in whole or individually, with a nice visual test runner.