Skip to content

env::current_dir() is not updated for non-root packages in a workspace #1514

Closed
@alecmocatta

Description

@alecmocatta

cargo test and cargo bench update the working directory when running the test binary. For example, if you have a foo sub-package in its own foo directory, then cargo test -p foo updates the working directory to ./foo when running its tests.

cargo miri test -p foo -- -Zmiri-disable-isolation does not update the working directory, so it's still . rather than ./foo. This breaks tests that rely on accessing files for test data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cargoArea: affects the cargo wrapper (cargo miri)C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions