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

Automatic test case collection #30

Closed
asomers opened this issue Jul 2, 2022 · 1 comment · Fixed by #31
Closed

Automatic test case collection #30

asomers opened this issue Jul 2, 2022 · 1 comment · Fixed by #31
Assignees
Labels
enhancement New feature or request

Comments

@asomers
Copy link
Collaborator

asomers commented Jul 2, 2022

In the beginning you asked me if you should use linker sections to implement automatic test case collection. I said no, because I was worried about schedule. But that was before I knew about the inventory crate, which makes it super-easy! I think we should use it. Still, it wasn't part of your proposal to include it, so I'll prepare a PR.

@asomers asomers added the enhancement New feature or request label Jul 2, 2022
@asomers asomers self-assigned this Jul 2, 2022
@saidsay-so
Copy link
Owner

Yes, I linked it on the issue along with linkme, when I was talking about linker sections and code before main!

saidsay-so pushed a commit that referenced this issue Jul 6, 2022
Use the inventory crate to automatically produce the list of test
functions to run.  Under the hood, it makes use of linker sections to
build the list of test cases.

With automatic test collection, there is no longer any need for multiple
tiers of test organization, apart from what the Rust module system
provides.  So remove the group! and test_case! macros (the new
test_case! macro corresponds to the old "test function").

Finally, rename some functions to remove the redundant "test_" prefix.

Fixes #30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants