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:

  1. Set up a Python virtual environment in .env.
  2. Install necessary Python dependencies.
  3. Launch a local test server.
  4. 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:

  1. Select the SocketRocketTests target.
  2. Press Cmd+U to run the tests.
  3. Ensure your destination is a Mac or Simulator.