Tests¶
SEEREP uses GoogleTest for C++ Unit Tests
and pytest for integration tests. Unit
tests are placed into the individual ROS packages while the intregation tests
are setup in the /test
directory. The tests run automatically as a GitHub
Action with every push.
C++ Unit Tests¶
Currently unit tests are set up for:
- Flatbuffer ROS Conversions: Functions for converting ROS message to Flatbuffers message and vice versa.
- HDF5 PB Image Interface : Reading and writing of Protocol Buffer image messages to HDF5.
- HDF5 FB Image Interface : Reading and writing of Flatbuffer image messages to HDF5.
Using catkin¶
To run the tests with catkin
use:
catkin test # run all availabe tests
catkin test <specific-package> # run all tests from a specific package
Python Integration Tests¶
The integration tests, based on the Python examples, cover most of the send and receive operations of SEEREP.
Using pytest¶
To run all integration tests use:
in the main repository directory.
To execute a subset of the integration tests use:
# Recursively executes all tests in the meta directory
pytest tests/python/gRPC/meta
# Same execution as above
cd tests/python/gRPC/meta
pytest
# Run all tests specified in this file
pytest tests/python/gRPC/meta/test_gRPC_pb_projectCreation.py
Testing through VSCode¶
Another way to run the tests is through the VSCode Testing Tab ( icon)
Info
With a fresh installation of the project, the test cases might not be recognized. To resolve this, use the button in the top menu to refresh.
To run the tests use the button at the top or select individual test cases to run.