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

Add attribute test macro #1470

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mokeyish
Copy link
Contributor

@LaurentMazare I noticed that the current test macro is not very convenient. I think attribute macro would be better, I changed part of it. If you also think this is better. I'd be happy to update all unit tests to use attribute macro.

https://github.com/huggingface/candle/blob/main/candle-core/src/test_utils.rs#L5-L7
// TODO: Switch to generating the two last arguments automatically once concat_idents is
// stable. rust-lang/rust#29599


image

@LaurentMazare
Copy link
Collaborator

I don't feel that it's really worth making a separate crate for this as it's a pretty small number of lines of code and the number of code is already large. That said, if convenient to you feel free to have this in some of your helper crates.

@mokeyish
Copy link
Contributor Author

I don't want to make a separate crate either, mainly procedural macros have to be like this.

https://doc.rust-lang.org/reference/procedural-macros.html#the-proc_macro-crate

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.

2 participants