Cargo test ::: specifying features


#1
  1. Running “cargo test” works fine.

  2. I have a number of tests of the form

#[cfg(feature = "gpu")]
#[test]
pub fn ... {
...
}
  1. How do I run the above tests (that require feature gpu)? I have found https://github.com/rust-lang/cargo/issues/2911 … which seems to suggest that it is not possible to pass features?[

#2

run cargo test --feature gpu. It’s not possible to have the gpu feature enabled automatically.


#3

Minor typo: it’s --features :slight_smile:
Everything works now. Thanks!