Run cargo test with the --features flag followed by your feature name to execute tests gated by that feature. This compiles the code with the specified feature enabled and runs all tests, including those marked with #[cfg(feature = "...")].
cargo test --features your_feature_name
To run tests for multiple features, separate them with commas:
cargo test --features feature_a,feature_b
To run tests with all features enabled, use the --all-features flag:
cargo test --all-features