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

fix: append #[::core::prelude::v1::test] only if it does not exist #46

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kezhuw
Copy link

@kezhuw kezhuw commented Apr 19, 2024

This way if preceding test macros add #[::core::prelude::v1::test] by appending, then we can avoid duplicated test runs.

See also frondeus/test-case#101, frondeus/test-case#143

Closes #35.

This pr depends on frondeus/test-case#143 and tokio-rs/tokio#6497.

This way if preceding test macros add `#[::core::prelude::v1::test]` by
appending, then we can avoid duplicated test runs.

See also frondeus/test-case#101, frondeus/test-case#143

Closes d-e-s-o#35.
Copy link
Owner

@d-e-s-o d-e-s-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the proposal! I am fine with the approach. Left a few nitpicks.

This pr depends on frondeus/test-case#143 and tokio-rs/tokio#6497.

Can we please wait until these are merged? I'd rather not include any temporary patches.

macros/src/lib.rs Outdated Show resolved Hide resolved
macros/src/lib.rs Outdated Show resolved Hide resolved
macros/src/lib.rs Outdated Show resolved Hide resolved
@kezhuw
Copy link
Author

kezhuw commented Apr 20, 2024

@d-e-s-o Thank you for reviewing. I am good with the merge timing.

I have pushed with a fixup commit to solve your concerns. Also, I checked that there is no duplicated test runs for new test cases. cargo test with_existing runs 2 tests, cargo test with_append runs 7 tests including ones generated by test_case.

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.

#[test_log::test(test_case::test_case)] doesn't work with multiple cases
2 participants