Improved testing using a new glob macro #95
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR sets up a new
glob
attribute macro, intended to be used in tests. This helps split each of the larger snapshot tests up into smaller functions, allowing for parallelism between the snapshotted files when runningcargo nextest run
orcargo test
.There wasn't an existing crate that I could use that had
glob
at macro level, and to introduce a new proc macro, we need to set up a separate crate; this is set up as a crate within the same workspace. In the future, if I find this useful for other use cases too, I might split it off as a separate crate entirely, but for now, it can sit in this workspace.It is easiest to see the impact of this change by looking at the output of
cargo nextest run
(or ~equivalently,cargo test
). Before this PR, the entirety ofverus-snapshot/**/*.rs
ran within a single test function, but after this, each file gets its own function.