I am writing a test:
#[cfg(test)]
mod tests {
#[test]
fn test_something() {
//content of test function
}
}
Is it possible to make this test not run when using Windows and only run on Linux?
I am writing a test:
#[cfg(test)]
mod tests {
#[test]
fn test_something() {
//content of test function
}
}
Is it possible to make this test not run when using Windows and only run on Linux?
You can choose to not compile the test at all
#[cfg(not(target_os = "windows"))]
#[test]
fn test_something() {
//content of test function
}
Or you can choose to compile it but not run it:
#[test]
#[cfg_attr(target_os = "windows", ignore)]
fn test_something() {
//content of test function
}
See also: