Comments (8)
@quininer and @mssun, I've released escargot
v0.3.0 with CargoRun
support (see docs).
Could you give that a spin to see what you thoughts are? If it works for you, I'll be closing this issue by
- Removing the
_path
functions from the API (and by extension, removing thecargo
mod from the API) - Updating the docs to point to
escargot
for advanced use cases (custom builds, caching, etc).
We still need to decide whether the easy-path API should use current_target
or not.
from assert_cmd.
I am satisfied with this API, but CargoRun
does not seem to work for --example
. I got "No binaries in crate".
from assert_cmd.
Thanks @epage, I'm pretty satisfied with the API.
Now I can use
lazy_static! {
pub static ref BIN_PATH: PathBuf = escargot::CargoBuild::new()
.bin("binary_name")
.current_release()
.current_target()
.run()
.unwrap()
.path()
.to_path_buf();
}
to get the path of binary which compiled with --target xxx
.
This works well when test with cargo test --target xxx
.
However, when I don't use --target xxx
to test (e.g., test the default target: x86_64-unknown-linux-gnu
), escargot
will still build the binary again and put it into target/x86_64-unknown-linux-gnu/debug
instead of target/debug
. Seems that escargot
cannot detect the existence of the --target
flag.
from assert_cmd.
I am satisfied with this API, but CargoRun does not seem to work for --example. I got "No binaries in crate".
I know exactly whats wrong and will hopefully get a chance to fix it soon. In the mean time, could you open an issue for it on escargot?
How come you are caching the path rather than caching the CargoRun
and then using BIN.command()
to access all the assert_cmd features
However, when I don't use --target xxx to test (e.g., test the default target: x86_64-unknown-linux-gnu), escargot will still build the binary again and put it into target/x86_64-unknown-linux-gnu/debug instead of target/debug. Seems that escargot cannot detect the existence of the --target flag.
It cannot and that is the crux of #4.
from assert_cmd.
It cannot and that is the crux of #4.
Yes, I understand. Thank you. This requires me to run cargo test
with --target
in any case. But, seems that there is no solution for this.
from assert_cmd.
Remaining work: figure out target
from assert_cmd.
Specifying features (see #34)
Can I specify the features now? The use case is that we want to test some features which are not default.
from assert_cmd.
Yes, though it will require adding a dependency on escargot
and callling into that, rather than using CommandCargoExt
.
See the implementation of CommandCargoExt
for how you might do this:: https://github.com/assert-rs/assert_cmd/blob/master/src/cargo.rs#L137
Drat, it doesn't look like I've added a feature
argument to escargot
. I've created crate-ci/escargot#10. Feel free to implement it or use the suggested workaround. Eventually I'm going to need it anyways but I'm assuming your needs are more pressing.
from assert_cmd.
Related Issues (20)
- stdout/stderr for text processes is ugly HOT 4
- Unable to test TTY behavior HOT 5
- Document how to use assert_cmd with rust-cross HOT 5
- How to handle permissions? HOT 8
- Improve the Debug implementation of Command HOT 1
- Assert#dump() HOT 2
- Some help with getting started HOT 4
- Running a binary in cargo workspace HOT 3
- .timeout() functionality does not work on payload processes with children HOT 3
- Dependency Dashboard
- Track performance metrics of child processes HOT 2
- how to trigger binary builds from 'cargo test' HOT 2
- Allow customising number of lines shown before <n lines omitted> HOT 6
- unknown feature `proc_macro_span_shrink` with Rust 1.74.0 HOT 3
- Documentation for subcommand HOT 1
- Reexport `predicates` in crate root HOT 1
- Add .try_assert() for a panic-free version of .assert() HOT 1
- Add input/output redirection support
- how to trigger debugging in vscode when use Command::cargo_bin("")? HOT 1
- Does not work in GitHub Actions HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from assert_cmd.