Skip to content

Use CARGO_TARGET_TMPDIR if set #2

Description

@dimo414

Cargo provides a temp directory for integration tests via CARGO_TARGET_TMPDIR. It's unfortunately not currently set for unit tests but it might still be nice to use it when it's available (I am only using testdir with integration tests, and I imagine that's somewhat typical). rust-lang/cargo#9375 has some context behind the motivation for this variable and why it's only set for integration tests.

FWIW I went looking for this setting because I was a little surprised testdir creates all its directories right in the target/ root; it ends up creating nine entries that seem like they could be nested under a common parent directory to keep the root dir cleaner. So in addition to / instead of using CARGO_TARGET_TMPDIR it might be nice to put all these paths under a single common directory such as target/testdir/dir-*.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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