-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix extendr_module
importing
#469
Conversation
`use module::get_module_metadata`.
I accidentally made a branch from a branch where I just was half done doing something. |
Can you write a test for this? |
I've no idea how to... |
Maybe an integration test that has multiple Rust modules in the same file, each with their own |
the trait `GetSexp`.
Perfect. I added a test and fixed another |
Hmm it would be nice to be able to make assertions about the generated code. Can you call the |
I'll think about that. But no I don't think that this is easily possible. I'm hoping this is a smal pr that we would get merged soon. And released. It is very annoying to users. |
I understand the desire to get it merged, but from my perspective as a reviewer I have no particular evidence that this works. Each module should define a |
First, I did put the integration test that you wanted. And that one shows that this now works. So these functions are already being called. I do valid your input and if I can make this more robust in the future, I'll make a PR. |
This is a an issue with the current code-base that Andy had already warned us about in #404. Quite frankly it is up to people like me to clean this sort of thing up, but I've not done it before now. |
Alright, I think we should merge this ASAP. I'm going to request rewiews now. |
Oh I see.
Anything in `crate/tests` are integration tests.
These things are not runtime things, but compile-time issues.
I'm not going to add a runtime test for the compile-time proc-macro in this
PR.
…On Thu, Feb 9, 2023 at 4:47 PM Ilia Kosenkov ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In extendr-api/tests/extendr_module_tests.rs
<#469 (comment)>:
> @@ -0,0 +1,28 @@
+//! Tests for [`extendr_module`] procedural macro.
+//!
+mod root {
I was suggesting putting this (or similar code) into extendrtests -- an R
integration test package. There, if you can safely call one of the
functions of an inner module, this guarantees we get correct metadata.
—
Reply to this email directly, view it on GitHub
<#469 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAIDVSANUJXPIFXSONMPF6LWWUGRDANCNFSM6AAAAAAUQZTRXU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Alright, so the |
* Started documenting the `#[extendr]` proc-macro * fixes the need for `use module::get_module_metadata`. * Revert some changes * Added an integration test. * Fixed the need to import the trait `GetSexp`. * expanded the test with an adjacent module * This should now force the extendrtests to test this bug
The issue is that these
get_<module>_metadata
are generated in their respective modules, but then they aren't realy imported in the place where they get recursively called.Others experienced this, see discord message