Integration tests are located in the tests/ directory and are gated with #[ignore] by default because they require an external peripheral.
To run tests, you must have either the Zephyr firmware running on an nRF52 DK or the Python Bumble server running.
Run all integration tests:
# Note: must include --ignored to run the gated tests
cargo test --test '*' -- --ignored
Run a specific test file:
cargo test --test test_read_write
Run only unit tests (skipping integration tests):
cargo test --lib
Customizing Peripheral Discovery:
You can override the default device name ("btleplug-test") by setting the BTLEPLUG_TEST_PERIPHERAL environment variable. This is useful if you have multiple test boards.
# With hardware peripheral (nRF52 DK running, or Bumble started):
cargo test --test test_read_write
# All integration tests:
cargo test --test '*'
# Skip integration tests (unit tests only):
cargo test --lib
# To actually run the ignored integration tests:
cargo test --test '*' -- --ignored