I encountered this crate while looking for an existing attribute macro that would do pretty much exactly what this does.
My preference would be to make it possible to see which test is skipped by creating a noop test case in its place if the environment variable isn't set. For example, the following:
#[needs_env_var(MYVAR)]
#[test]
fn mytest() {
assert!(false);
}
would be expanded at compile time to something like
#[test]
fn mytest_SKIPPED_NEEDS_MYVAR() {
assert!(true);
}
I encountered this crate while looking for an existing attribute macro that would do pretty much exactly what this does.
My preference would be to make it possible to see which test is skipped by creating a noop test case in its place if the environment variable isn't set. For example, the following:
would be expanded at compile time to something like