Skip to content

unresolved imports in tests #138

@Geal

Description

@Geal

hello, when I try to use the new ctest feature, I get compilation errors if I have other tests in the tests/ directory.

How to reproduce: create example-project/tests/other.rs with the following content:

use example_project::OddCounter;

#[test]
fn test() {
}

When I run cargo test, that integration test is compiled and runs fine, but when I run cargo ctest, I get this error:

error[E0432]: unresolved import `example_project`
 --> tests/other.rs:1:5
  |
1 | use example_project::OddCounter;
  |     ^^^^^^^^^^^^^^^ use of undeclared crate or module `example_project`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
Error: CliError { error: Some(could not compile `example-project`

is it changing the crate name?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions