Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add support for custom test attributes #82

Merged
merged 1 commit into from
Mar 5, 2024
Merged

Conversation

foresterre
Copy link
Owner

You may now add the attribute #[parameterized_macro(...)] after a #[parameterized(...)] attribute. The ... in the parameterized_macro may be replaced with a custom test attribute such as tokio::test.

As an additional treat (because the above would not half be as useful without some of these), the parameterized test function now also parses and provides codegen for the async, const and unsafe keywords, in addition to the also newly added support for specifying return types.

closes #80

You may now add the attribute #[parameterized_macro(...)] after a #[parameterized(...)] attribute. The ... in the parameterized_macro may be replaced with a custom test attribute such as tokio::test.

As an additional treat (because the above would not half be as useful without some of these), the parameterized test function now also parses and provides codegen for the async, const and unsafe keywords, in addition to the also newly added support for specifying return types.
@foresterre foresterre enabled auto-merge (rebase) March 5, 2024 07:07
@foresterre foresterre merged commit e018621 into main Mar 5, 2024
10 checks passed
@foresterre
Copy link
Owner Author

This is now supported and will be released as 2.0.0

Example usage:

parameterized/src/lib.rs

Lines 95 to 111 in e018621

mod custom_test_attribute {
use super::*;
ide!();
#[parameterized(input = { true, true, true })]
#[parameterized_macro(tokio::test)]
async fn tokio_simple_meta(input: bool) {
assert!(input)
}
#[parameterized(input = { true, true, true })]
#[parameterized_macro(tokio::test(flavor = "multi_thread", worker_threads = 1))]
async fn tokio_complex_meta(input: bool) {
assert!(input)
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

#[tokio::test] support
1 participant