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: function-like macro for generating tests #10233

Merged
merged 3 commits into from
Aug 9, 2024
Merged

Conversation

klkvr
Copy link
Collaborator

@klkvr klkvr commented Aug 9, 2024

add_arbitrary_tests doesn't work great with generics which resulted in issues for some types in #10201

this PR changes generated code to allow inferring default generics where possible and adds generate_tests macro which allows generating tests for specific types, making it possible to generate multiple test modules for the same struct with different generics

macro invocation should look as following: generate_tests!(#[rlp, compact] NewBlock<BlockType> TestModuleName)

@klkvr klkvr requested a review from joshieDo as a code owner August 9, 2024 12:19
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

cool, only doc nits

crates/storage/codecs/derive/src/lib.rs Show resolved Hide resolved
@mattsse mattsse added the C-test A change that impacts how or what we test label Aug 9, 2024
@mattsse mattsse enabled auto-merge August 9, 2024 14:17
@mattsse mattsse added this pull request to the merge queue Aug 9, 2024
Merged via the queue into main with commit 1d83d14 Aug 9, 2024
33 checks passed
@mattsse mattsse deleted the klkvr/generate-tests branch August 9, 2024 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-test A change that impacts how or what we test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants