Skip to content

Tests dont show up when using additional proc macro. #17011

@t-moe

Description

@t-moe

I have an integration test which looks as follows:

#![no_std]
#![no_main]

#[cfg(test)]
#[embedded_test::tests]
mod tests {
    #[test]
    fn test_a() {
        assert!(true)
    }

   #[test]
    fn test_b() {
        assert!(false)
    }
}

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-supportCategory: support questions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions