Testing SocketRocket
SocketRocket comes with a comprehensive test suite to ensure compliance with the WebSocket protocol (RFC 6455).
Requirements
The test suite relies on Python and the AutobahnTestsuite. The project includes a Makefile to handle dependencies.
Running Unit Tests
To run the short test suite (unit tests) from the command line:
make test
This command will:
- Set up a Python virtual environment in
.env. - Install necessary Python dependencies.
- Launch a local test server.
- Run the tests.
Running All Tests (Autobahn)
SocketRocket conforms to the Autobahn fuzzing tests. To run the full suite:
make test_all
Note: This can take a significant amount of time as it runs ~300 fuzzing cases.
Testing in Xcode
You can also run tests directly within Xcode for debugging purposes:
- Select the
SocketRocketTeststarget. - Press
Cmd+Uto run the tests. - Ensure your destination is a Mac or Simulator.