Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show errors in Rust test code #626

Closed
jonhoo opened this issue Jun 5, 2017 · 3 comments
Closed

Show errors in Rust test code #626

jonhoo opened this issue Jun 5, 2017 · 3 comments

Comments

@jonhoo
Copy link
Contributor

jonhoo commented Jun 5, 2017

The Cargo maker, as currently defined, will only build/check the main binary or library. To also get errors in additional targets (like other binaries) or in tests, the commands that are run must be tweaked a little. If not using cargo check, the right command to run is probably cargo test --no-run, which should build all targets, including tests, but not run anything. When g:ale_rust_cargo_use_check is set, ALE will currently run cargo check with no additional flags. However, this will only check non-test code, and only for the library. To test all targets, cargo check --all should be used.

Unfortunately, --all does not check tests. rust-lang/cargo#4039 attempts adds --tests, but still seems to be some way away from landing. --all is a good half-way point in the meantime though. This is also the conclusion that was reached for neomake in neomake/neomake#843 (comment).

@w0rp
Copy link
Member

w0rp commented Jun 6, 2017

I guess someone can add --all. They might want to check the version of cargo before passing the argument.

@jonhoo
Copy link
Contributor Author

jonhoo commented Oct 31, 2017

Now that rust-lang/cargo#4592 has landed, the thing we want is --all-targets (see also rust-lang/cargo#2495 (comment)).

@w0rp w0rp closed this as completed in 7b5108d Nov 5, 2017
@w0rp
Copy link
Member

w0rp commented Nov 5, 2017

Now cargo check will automatically be used when cargo is new enough, and cargo check --all-targets will be used when cargo is new enough. g:ale_rust_cargo_use_check or g:ale_rust_cargo_check_all_targets can be set to 0 to disable one or both.

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

No branches or pull requests

2 participants