GithubHelp home page GithubHelp logo

Comments (8)

epage avatar epage commented on August 23, 2024

@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 the cargo 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.

quininer avatar quininer commented on August 23, 2024

I am satisfied with this API, but CargoRun does not seem to work for --example. I got "No binaries in crate".

from assert_cmd.

mssun avatar mssun commented on August 23, 2024

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.

epage avatar epage commented on August 23, 2024

@quininer

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?

@mssun

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.

mssun avatar mssun commented on August 23, 2024

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.

epage avatar epage commented on August 23, 2024

Remaining work: figure out target

from assert_cmd.

mssun avatar mssun commented on August 23, 2024

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.

epage avatar epage commented on August 23, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.