Skip to content

Commit 6428c3d

Browse files
author
Brendan Whitfield
committed
Updated the testing docs with modern build commands
1 parent 630f0be commit 6428c3d

File tree

1 file changed

+27
-3
lines changed

1 file changed

+27
-3
lines changed

tests/README.md

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,34 @@
11
Testing
22
=======
33

4-
To test python-OBD, you will need to `pip install pytest` and install the module (preferably in a virtualenv) by running `python setup.py install`. The end-to-end tests will also require [obdsim](http://icculus.org/obdgpslogger/obdsim.html) to be running in the background. When starting obdsim, note the "SimPort name" that it creates, and pass it as an argument to py.test.
4+
To test python-OBD, you will need to install `pytest` and the `obd` module from your local tree (preferably in a virtualenv) by running:
55

6-
To run all tests, run the following command:
6+
```bash
7+
pip install pytest
8+
pip install build
9+
python -m build
10+
pip install ./dist/obd-0.7.2.tar.gz
11+
```
712

8-
$ py.test --port=/dev/pts/<num>
13+
To run all basic python-only unit tests, run:
14+
15+
```bash
16+
py.test
17+
```
18+
19+
This directory also contains a set of end-to-end tests that require [obdsim](http://icculus.org/obdgpslogger/obdsim.html) to be running in the background. These tests are skipped by default, but can be activated by passing the `--port` flag.
20+
21+
- Download `obdgpslogger`: https://icculus.org/obdgpslogger/downloads/obdgpslogger-0.16.tar.gz
22+
- Run the following build commands:
23+
```bash
24+
mkdir build
25+
cd build
26+
cmake ..
27+
make obdsim
28+
```
29+
- Start `./bin/obdsim`, note the `SimPort name: /dev/pts/X` that it creates. Pass this pseudoterminal path as an argument to py.test:
30+
```bash
31+
py.test --port=/dev/pts/<num>
32+
```
933

1034
For more information on pytest with virtualenvs, [read more here](https://pytest.org/dev/goodpractises.html)

0 commit comments

Comments
 (0)