Files
timely-reference/test
Max Regan 0ee9d39e81 Clean up test code
Separate/consolidate board initialization code, and a few functions
that are shared across tests. Update the Makefile accordingly.

Resolves #18
2020-06-12 18:57:09 -07:00
..
2020-06-12 18:57:09 -07:00

This directory contains the test code and other requirements in order to run the hardware integration tests for the Timely Reference.

The Docker image uses SEGGER's JLink software tools, and requires accepting their license. This may be swapped out for OpenOCD in the future.

Of course, the tools can also be installed directly into the host- Docker provides a (more) consistent runtime environment and forces documentation of setup steps.

Hardware Requirements

Current:

The current hardware detection mechanisms may fail if more than one these devices is connected.

Execution

First, build the docker image. Depending on your execution environment, you may need to escalate privileges in order to run docker.

cd <project-root>
docker build -t tr-test test/

Then, execute the tests. The tests require access to the USB hardware components, so their files need to be volume-mounted in, and the container must be given privilege in order to access the devices.

docker run --privileged -it -v /dev/bus/usb:/dev/bus/usb -v $(pwd):/build-dir tr-test /build-dir/test/src/tr_test/test.py

The tests also accept other arguments accepted by pytest.