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
Tests dont show up when using additional proc macro. #17011
Comments
Ah, the tests macro (at least for |
The idea is that you set up a cargo runner (e.g. something like "probe-rs run"), which will download the elf file.. After flashing, when the MCU boots, it will then call the exported main function and run the tests in order. |
I'll try whether I can fix this on my end by emitting |
That would be one way, but I'll try adding something that considers exported mains inside cfg(test) modules to be test functions, as that looks like a test for a custom runner |
That would be great. I'm a bit hesitant with emitting the |
… r=Veykril fix: Consider `exported_name="main"` functions in test modules as tests Fixes rust-lang/rust-analyzer#17011
I have an integration test which looks as follows:
With the line
#[embedded_test::tests]
in place, rust analyzer wont show "Run Tests | Debug".As soon as I remove the line, it works as expected.
I'm the author of embedded-test.
Since this used to work before, I'm now unsure whether this broke because of a change on my side (embedded-test lib) or a recent change in rust anaylzer. To me it looks like this is due to a recent change in rust-analyzer since the buttons also disappear when using the macro provided by defmt-test
Can you point me to the relevant parts of the rust analyzer source code (that decides whether it is a test or not) ?
EDIT: probably https://github.com/rust-lang/rust-analyzer/blob/master/crates/ide/src/runnables.rs ?
Thank you
rust-analyzer version: 0.3.1906-standalone
rustc 1.79.0-nightly (88c2f4f5f 2024-04-02)
The text was updated successfully, but these errors were encountered: