Skip to content
This repository has been archived by the owner on Dec 29, 2021. It is now read-only.

Cannot run main_binary from a different directory #95

Closed
epage opened this issue Mar 23, 2018 · 2 comments
Closed

Cannot run main_binary from a different directory #95

epage opened this issue Mar 23, 2018 · 2 comments
Labels

Comments

@epage
Copy link
Collaborator

epage commented Mar 23, 2018

Say you want to change the cwd to a tempdir. When main_binary calls cargo run, it won't be able to find the Cargo.toml file.

@epage
Copy link
Collaborator Author

epage commented Mar 23, 2018

To fix this, we'll need to have main_binary look up from cwd the Cargo.toml and pass it to cargo run --manifest-path.

@epage epage added the bug label Mar 23, 2018
epage added a commit to epage/assert_cli that referenced this issue May 25, 2018
This switches us from using `cargo run` to `cargo build`, reading where
the binary is placed, and callin that instead.

Fixes assert-rs#95 because the user changing the `CWD` doesn't impact `cargo
build`.

Fixes assert-rs#79 because there is no `cargo` output when capturing the user's
stdout/stderr.

Fixes assert-rs#51 because the user changing the environment doesn't impact
`cargo build`.

This is a step towards working around assert-rs#100 because we can allow a user
to cache the result of `cargo build`.
@epage
Copy link
Collaborator Author

epage commented May 29, 2018

Addressed in assert_cmd
https://github.com/assert-rs/assert_cmd
assert_cli is going to morph into a wider-focused tool, including things like assert_fs. See #41

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant