-
Notifications
You must be signed in to change notification settings - Fork 39
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
Getting current test case description from within the test function #112
Comments
There's currently no way to get the description or name of a test from within it's body. There were discussions regarding having this functionality #37, however we didn't implement anything this far. It shouldn't be hard to add |
I know there is separate https://crates.io/crates/function_name crate that gives such a macro. I wonder if this will work as workaround or even inspiration for this issue solution |
@luke-biel: thanks for the honest feedback! I’m still unsure about my macro foo in rust so I will not tackle that right away before getting more familiar with the language. @frondeus: I did try that the other day as a workaround, but the function name reported it the original function name (which is untouched in the DSL I guess). The only workaorund I found was to go through the thread name, (which work unless you force all your tests in a single thread). |
Ah yes, I made test by myself, you are right. Those two macros are incompatible :( I will think about the solution :) |
Hey, great crate enabling to do table testing in Rust!
As part of most of the tests, I generate golden files after deserializing structs for instance or generated tree content. One way to identify them in a table testing environment is to generate based on the sub test name, and I feel the description will be really helpful for this.
Is there a way to get back the description within the test to achieve this? I would prefer not add an additional attribute and repeating the test description, but that’s a possible workaround.
Thanks!
The text was updated successfully, but these errors were encountered: