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: Emit test names in Run test runnables if they come from a macro expansion #9449

Merged
merged 1 commit into from
Jul 11, 2021

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Jul 1, 2021

Fixes #8964
Before:
Code_D1Tu5Iuh5I
After:
image

Basically when a macro emits more than one test we name the test functions/modules name in the runnable instead to not emit a bunch of equally named Run Test annotations which don't really tell much.

Note that the Run fibonacci_test Tests line is below the attributes due to the fact that the function name span is being reused for the generated module in rstest's expansion.

@Veykril
Copy link
Member Author

Veykril commented Jul 1, 2021

r? @matklad
(once you are back from vacation 🏝️)

@Veykril Veykril changed the title Emit test name in Run test runnables if it comes from a macro expansion feat: Emit test names in Run test runnables if they come from a macro expansion Jul 1, 2021
crates/ide/src/runnables.rs Outdated Show resolved Hide resolved
crates/ide/src/runnables.rs Outdated Show resolved Hide resolved
crates/ide/src/annotations.rs Show resolved Hide resolved
@matklad
Copy link
Member

matklad commented Jul 11, 2021

Let me take a look if I can refactor this better then!

bors r+

@bors
Copy link
Contributor

bors bot commented Jul 11, 2021

@bors bors bot merged commit 325140a into rust-lang:master Jul 11, 2021
@Veykril Veykril deleted the runnables branch August 2, 2021 12:09
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.

Support for #[rstest] tests
2 participants