Commit graph

2311 commits

Author SHA1 Message Date
bors cc88d01166 Auto merge of #5908 - orium:fix-package-cargo-toml, r=alexcrichton
Fix serialization bug in `edition` field of `TomlProject`.

Fixes #5906.
2018-08-19 17:40:22 +00:00
bors a78f5aaa84 Auto merge of #5904 - dwijnand:backslash, r=alexcrichton
Remove backslash management in 2 tool_paths tests

With #5851 this is no longer necessary
2018-08-19 16:18:59 +00:00
Dale Wijnand c882b4e02e
Fix 3 corner tests where whitespaces are important 2018-08-19 10:16:08 +01:00
Diogo Sousa 8590a5fba4 Fix serialization bug in edition field of TomlProject.
Fixes #5906.
2018-08-18 23:24:47 +01:00
Dale Wijnand 0152f26405
Move .env/.masquerade_as_nightly_cargo to collapse some more p.cargo calls 2018-08-18 21:34:09 +01:00
Dale Wijnand 511d4bc503
Collapse multiline ProcessBuilder::arg calls in tests
.. by calling this a bunch of times:

    fastmod --multiline '\.cargo\("([^"]+)"\).[ ]+\.arg\("([^"]+)"\)' '.cargo("${1} ${2}")' tests/testsuite/
2018-08-18 15:12:54 +01:00
Dale Wijnand af4f1392f7
Collapse ProcessBuilder::arg calls in tests
.. with mutliple calls of:

    fastmod --accept-all '\.cargo\("([^"]+)"\)\.arg\("([^"]+)"\)' '.cargo("${1} ${2}")' tests/testsuite/

until no changes are left.
2018-08-18 15:05:45 +01:00
Dale Wijnand 9d9883b26c
Single slash root on Windows 2018-08-18 12:20:00 +01:00
Dale Wijnand 4c9d42e0c7
Remove backslash management in 2 tool_paths tests 2018-08-18 10:19:39 +01:00
Dale Wijnand e0b9e43771
Collapse let bindings 2018-08-13 12:00:01 +01:00
Dale Wijnand 0c89a748d1
Resolve a drop_copy lint warning 2018-08-13 11:12:17 +01:00
Dale Wijnand 11922d099b
Resolve a identity_conversion lint warning 2018-08-13 11:11:50 +01:00
Dale Wijnand 972b312a08
Resolve a single_match lint warning 2018-08-13 11:11:04 +01:00
Dale Wijnand 3fdec5a2c6
Resolve a const_static_lifetime lint warning 2018-08-13 11:10:44 +01:00
Dale Wijnand c9b59deb3a
Resolve 4 unreadable_literal lint warnings 2018-08-13 11:10:03 +01:00
Dale Wijnand d0624dfcd7
Resolve 2 unneeded_field_pattern lint warnings 2018-08-13 11:09:25 +01:00
bors ae97799980 Auto merge of #5876 - matthiaskrgr:clippy_2, r=alexcrichton
fix a bunch of clippy warnings

 (invocation: cargo clippy --all-targets --all-features -- --cap-lints warn )
2018-08-12 22:42:53 +00:00
Matthias Krüger 8798bf0d28 fix a bunch of clippy warnings (invocation: cargo clippy --all-targets --all-features -- --cap-lints warn )
Special thanks to dwijnand for helping me with this! :)
2018-08-12 10:00:12 +02:00
Dale Wijnand 2c704d8841
Add a test for "cargo doc --message-format=short" 2018-08-10 08:49:15 +01:00
Dale Wijnand a14f7fe024
Add a test for "cargo check --message-format=short" 2018-08-10 08:22:39 +01:00
Dale Wijnand 28a84e02e5
Add support for rustc's --error-format short
Running a local build of this branch on some broken code shows this kind of output:

    18:42:29 $ dcargo check --message-format=short --tests
        Checking bufstream v0.1.3
        Checking cargo v0.30.0 (file:///d/cargo)
    tests/testsuite/config.rs:298:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:307:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:363:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:367:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:371:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:375:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:382:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:386:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:400:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:428:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:479:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:491:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:496:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:501:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:506:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:512:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:582:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:660:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:666:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:672:9: error[E0308]: mismatched types
    tests/testsuite/config.rs:678:9: error[E0308]: mismatched types
    error: aborting due to 21 previous errors
    error: Could not compile `cargo`.
    warning: build failed, waiting for other jobs to finish...
    error: build failed
2018-08-10 08:22:39 +01:00
bors 578e2533b8 Auto merge of #5878 - ehuss:rustdoc-json, r=alexcrichton
Support JSON with rustdoc.

This allows `cargo doc --message-format=json` to actually work.

Note that this explicitly does not attempt to support it for doctests for
several reasons:
- `rustdoc --test --error-format=json` does not work for some reason.
- Since the lib is usually compiled before running rustdoc, warnings/errors
  will be emitted correctly by rustc.
- I'm unaware of any errors/warnings `rustdoc --test` is capable of producing
  assuming the code passed `rustc`.
- The compilation of the tests themselves do not support JSON.
- libtest does not output json, so it's utility is limited.
2018-08-10 03:14:33 +00:00
Eric Huss c28823fa00 Update for review comments. 2018-08-09 15:43:34 -07:00
Eric Huss f3faa976fa Support JSON with rustdoc.
This allows `cargo doc --message-format=json` to actually work.

Note that this explicitly does not attempt to support it for doctests for
several reasons:
- `rustdoc --test --error-format=json` does not work for some reason.
- Since the lib is usually compiled before running rustdoc, warnings/errors
  will be emitted correctly by rustc.
- I'm unaware of any errors/warnings `rustdoc --test` is capable of producing
  assuming the code passed `rustc`.
- The compilation of the tests themselves do not support JSON.
- libtest does not output json, so it's utility is limited.
2018-08-08 23:59:07 -07:00
Eric Huss fa54a79433 Allow cargo run in workspaces. 2018-08-08 18:39:00 -07:00
bors ebaf2125d1 Auto merge of #5873 - ehuss:ws-filters, r=alexcrichton
Change target filters in workspaces.

This changes it so that filters like `--bin`, `--test`, `--example`,
`--bench`, `--lib` will work in a workspace.  Today, these filters
require that they match *every* package in a workspace which makes
them not very useful.  This change makes it so that they only must
match at least one package.

Closes #5819.
2018-08-07 22:57:38 +00:00
bors 0e7a46e327 Auto merge of #5858 - dekellum:git-check-logging-and-test, r=alexcrichton
Improve verbose console and log for finding git repo in package check

Third attempt to resolve #5823 by improving logging and tests. This exposes the issue to testing,  via verbose console output and is dependent on alexcrichton/git2-rs#341 as just released in git2 0.7.5 crate. Thus tests *should* now pass on all platforms, incl. windows, but I also intend to bump the minimal git2 release dependency (in a subsequently added commit).

cc: @Eh2406 thanks for your fix and help!
2018-08-07 22:19:54 +00:00
Eric Huss 771fec3cff Change target filters in workspaces.
This changes it so that filters like `--bin`, `--test`, `--example`,
`--bench`, `--lib` will work in a workspace.  Today, these filters
require that they match *every* package in a workspace which makes
them not very useful.  This change makes it so that they only must
match at least one package.
2018-08-07 13:05:22 -07:00
Aleksey Kladov 39b1f752f6 Add rename info to Cargo metadata
Previously, `cargo metadata` exposed dependencies info as a graph of
package id without any additional information on edges.

However, we do want to add some data to edges, including for example,
package renames and `cfg` info.

Internally, the edges info is represented as a `Vec<Dependnecy>`. We
could have exposed that directly, but that risks exposing and
ossifying an implementation details.

So instead we collapse a `Vec<Dependnecy>` to a single JSON object,
which at the moment contains `id` and `rename` info only. It should be
possible to add additional fields to that object backwards compatibly.
Such representation does not correspond directly to any internal Cargo
data structure, but hopefully it shouldn't be to hard to maintain.

This representation also does not quite correspond to the "real
world", where dependencies are between crate (cargo targets), and not
packages. However, because each dep edge is a JSON object, adding a
target filter should be possible, which would handle dev-, build-, and
potential future bin-specific dependencies backwards-compatibly.
2018-08-07 12:39:08 +03:00
Brandon Williams 4e13dc73cd fetch: skip target tests when cross_compile is disabled
Signed-off-by: Brandon Williams <bmwill@google.com>
2018-08-06 10:04:53 -07:00
bors b42488270e Auto merge of #5861 - alexcrichton:build-script-edition, r=ehuss
Fix the edition build scripts are compiled with

Previously build scripts were accidentally and unconditionally compiled with the
2015 edition, but they should instead use the edition of the `[package]` itself.

Closes #5860
2018-08-04 18:15:43 +00:00
Alex Crichton 152eca58d8 Fix the edition build scripts are compiled with
Previously build scripts were accidentally and unconditionally compiled with the
2015 edition, but they should instead use the edition of the `[package]` itself.

Closes #5860
2018-08-04 08:44:16 -07:00
bors 135ef53e09 Auto merge of #5852 - dwijnand:exit-code-0, r=alexcrichton
Default test support's Execs to exit code 0

Refs #5742
2018-08-03 15:42:54 +00:00
Dale Wijnand b1d6a7e11d
Drop niche Execs::with_no_expected_status
.. by gating the nightly-only tests.
2018-08-03 07:54:07 +01:00
Dale Wijnand 60828dba83
Fix tests that have no stable expected exit code 2018-08-03 07:45:21 +01:00
Dale Wijnand f53f2b0e94
Fix tests that have failing commands w/o specifying the exit code 2018-08-03 07:45:21 +01:00
Dale Wijnand 16aeb0cd4f
Default test support's Execs to exit code 0 2018-08-03 07:44:42 +01:00
Marat Safin b686606362 check target env in test when use targets 2018-08-03 08:31:33 +03:00
David Kellum 5b2f734873 Merge branch 'master' into git-check-logging-and-test 2018-08-02 15:42:50 -07:00
David Kellum 972763a8ee Improve verbose console and logging for finding git repo in package check 2018-08-02 15:21:04 -07:00
bors 5badfb1acb Auto merge of #5854 - dwijnand:args-split_whitespace, r=alexcrichton
Cleanup tests by using single string commands, split on whitespaces

Refs #5742
2018-08-02 22:12:33 +00:00
Dale Wijnand f88ff968ed
Fix install_empty_argument by passing an empty arg 2018-08-02 18:00:02 +01:00
Dale Wijnand dda661ddf2
Introduce git_process too 2018-08-02 18:00:02 +01:00
Dale Wijnand 8940d30668
Make cargo_process take a string it splits on whitespace 2018-08-02 18:00:02 +01:00
Alex Crichton 80f9d318d5 Add a --edition-idioms flag to cargo fix
This, like `--prepare-for`, will be part of the transition guide which
automatically applies the necessary lint group from the compiler to associated
code.

The `--edition-idioms` flag does not take an argument and will automatically
enable the right lint group based on the edition being compiled for.

cc #52679
2018-08-02 09:19:35 -07:00
bors e3a90f2097 Auto merge of #5845 - alexcrichton:fix-edition, r=alexcrichton
Rename `--prepare-for` to `--edition`, drop arg

This commit tweaks the UI of `cargo fix` for the edition. Previously you'd
execute `cargo fix --prepare-for 2018`, but that's a lot of typing! Plus it's
some manual data that Cargo can already infer.

Instead, after this commit, you now type `cargo fix --edition`, and that's it!
The idea is that this'll tell Cargo to fix code for the *next* edition,
inferring whatever edition is in use and figuring out what to pass to rustc.

Functionality-wise this should be the exact same as `--prepare-for 2018` though

If others agree w/ this change I'll send a PR to the edition guide after this
merges!
2018-08-02 14:57:35 +00:00
Dale Wijnand 2fe2ea9e71
Use p.cargo's ability to split on whitespace more 2018-08-02 15:18:44 +01:00
Dale Wijnand 5071b38281
Push slash conforming to lines_match, so match_json uses it 2018-08-02 12:21:17 +01:00
Dale Wijnand 05400b8018
Drop the [/] test output macro 2018-08-02 10:18:48 +01:00
Alex Crichton b2b120e9fd Rename --prepare-for to --edition, drop arg
This commit tweaks the UI of `cargo fix` for the edition. Previously you'd
execute `cargo fix --prepare-for 2018`, but that's a lot of typing! Plus it's
some manual data that Cargo can already infer.

Instead, after this commit, you now type `cargo fix --edition`, and that's it!
The idea is that this'll tell Cargo to fix code for the *next* edition,
inferring whatever edition is in use and figuring out what to pass to rustc.

Functionality-wise this should be the exact same as `--prepare-for 2018` though

If others agree w/ this change I'll send a PR to the edition guide after this
merges!
2018-08-01 15:03:15 -07:00