Skip to content

Feature request: customizable test attributes #9

@robgjansen

Description

@robgjansen

Thank you for your crate! :)

Would you consider supporting customizable test attributes? For example, I believe that currently tests are hard-coded to look like:

#[test]
fn my_test() {
    ...
}

But I would like to specify custom test attributes. Here is an example:

#[test]
#[ignore]
#[cfg(target_os = "linux")]
fn my_test() {
    ...
}

I think your code gets us pretty close, we just need a way to parse the attributes and paste them here instead of the hard-coded #[cfg(test)], right?

test-each-file/src/lib.rs

Lines 258 to 266 in 622d703

if let Some(module) = parsed.module {
tokens = quote! {
#[cfg(test)]
mod #module {
use super::*;
#tokens
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions