68 Commits

Author SHA1 Message Date
Eric Huss
4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07:00
Eric Huss
2fa95e3ec4 Add "Updating" status for git submodules. 2020-03-11 18:37:31 -07:00
Jun Wu
a2cddeeb9f Ignore broken Cargo.toml in git sources
Commit 3d6de4177489a5d450f35e92288512be85492678 (#3998) made cargo
ignore Cargo.toml files that are invalid TOML in a git source.
This change further ignores Cargo.toml files that are valid TOML but
cannot really be loaded.

This is potentially an alternative fix for #6822.
2020-02-29 09:31:52 -08:00
Eric Huss
1eca786d7f Add path to the failure to load a dependency. 2020-02-27 08:17:18 -08:00
Eric Huss
a07fec1b7b Provide extra context on a query failure. 2020-02-25 10:17:11 -08:00
Matthias Krüger
1d912002e9 fix most remaining clippy findings (mostly redundant imports) 2020-02-21 12:15:16 +01:00
Eric Huss
90887707ed Copy license-file into package if outside of root. 2020-02-20 13:27:25 -08:00
Matthias Krüger
8245e02924 bump git2 dependencies 2019-12-19 23:29:41 +01:00
Eric Huss
83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08:00
Dan Aloni
375a46f18b Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-18 08:56:13 +03:00
Alex Crichton
ebd10526f3 Run rustfmt 2019-09-16 12:00:12 -07:00
Alex Crichton
9115b2c326 Extract support directory to its own crate
Extract out all our test support code to its own standalone crate so it
can be shared between multiple test suites if necessary.
2019-09-16 11:47:09 -07:00
Dan Aloni
f0896975be Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-09-08 21:43:41 +03:00
Eric Huss
22adaf99b3 Update test to handle user.* git config missing in submodule. 2019-08-13 16:35:04 -07:00
Eric Huss
850a9d4282 Check in package/publish if a git submodule is dirty. 2019-08-13 16:10:22 -07:00
bors
85a52ce20e Auto merge of #7242 - ehuss:vendor-ignore-dot, r=alexcrichton
`cargo vendor`: Don't delete hidden top-level files.

`cargo vendor` (without `--no-delete`) will delete all files in the `vendor/` directory when it starts. This changes it so that it will skip any entries starting with a dot. This allows one to track the vendor directory with a source control system like git.

Closes #7109

(Note: two commits, one is a test change.)
2019-08-13 22:47:50 +00:00
Eric Huss
b41c209af3 Bump toml 0.5.3 2019-08-13 14:56:22 -07:00
Eric Huss
3c20a24335 Clean up some git test support functions. 2019-08-12 22:25:36 -07:00
Dan Aloni
27da33c67d Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-07-28 09:24:31 +03:00
Eric Huss
00fd31dd9b Clean environment when git-fetch-with-cli is used. 2019-06-29 13:32:21 -07:00
Dan Aloni
87183146d9 Merge remote-tracking branch 'origin/master' into custom-profile-pr-rfc 2019-06-20 16:18:42 +03:00
Jethro Beekman
0e0d968825 Update #[test] attribute on all tests in the testsuite
sed -i 's/^#\[test\]/#[cargo_test]/' $(rg -l '^#\[test\]')

Manual fixes:
* proc_macro::proc_macro_doctest
2019-06-07 12:41:26 -07:00
Dan Aloni
e25f6a4255 tests: fix finished line for 'cargo test' 2019-06-07 21:47:45 +03:00
Eric Huss
80b9d329ba Move offline tests to a dedicated file. 2019-04-28 19:45:01 -07:00
Eric Huss
bb614d4305 Fix test include_overrides_gitignore. 2019-04-14 11:50:41 -07:00
Eric Huss
1667b75abc Support force-pushed repos with git-fetch-with-cli. 2019-03-31 10:06:23 -07:00
Eric Huss
ef0b47769b Cleanup: Remove unnecessary borrows. 2019-03-26 18:09:56 -07:00
Jonathan Claudius
46b2b78754
Merge branch 'master' into https_all_the_things 2019-02-22 14:21:53 -05:00
Alexander Regueiro
f7c91ba622
Various cosmetic improvements. 2019-02-20 10:58:27 +00:00
Jonathan Claudius
0c3851c017
HTTPS all the things 2019-01-30 15:34:37 -05:00
Alex Crichton
fecb724643 Format with cargo fmt 2018-12-08 03:19:47 -08:00
Dale Wijnand
04ddd4d0fc
Upgrade to Rust 2018 2018-12-06 20:18:35 +01:00
Dale Wijnand
2e35475121
Add debug info to git::two_deps_only_update_one test 2018-11-26 11:04:01 +00:00
Alex Crichton
2a4cdc677c Never use templates when managing git repos
This commit disables usage of git templates whenever Cargo manages
repositories in its internal git database. Templates don't want to be
used at all in these situations and have been known to cause usability
bugs.

Closes #6240
2018-11-02 11:50:04 -07:00
Alex Crichton
e2637b6599 Review comments! 2018-09-18 11:33:18 -07:00
Zach Lute
b020d3789a Resolve merge conflicts with test string changes. 2018-09-09 16:48:57 -07:00
Dale Wijnand
41aa6fbab4
Update tests to new Updating msg format 2018-09-08 10:23:57 +01:00
Zach Lute
89f43938fe Print file paths instead of file:// URLs.
This change ensures cargo will output file paths in the expected format
(C:\foo\... on Windows, /foo/... elsewhere). Previously it would output
file:// URLs instead.

To support this change, additional changes were made to the test suite
string processing such that [ROOT] is now replaced with the appropriate
file path root for the platform.

The CWD template was also updated to use [CWD] like other replacement
templates and to do the replacement on the expected value rather than
the actual value to avoid replacing things we don't expect with CWD.
2018-09-07 19:42:59 -07:00
Eric Huss
e29aacca86 Add a way to skip the use_the_cli test for rust repo. 2018-09-04 14:01:49 -07:00
Matthias Krüger
2cd9cce6e3 clippy: resolve all warnings about useless format!() 2018-09-03 11:38:29 +02:00
Dale Wijnand
d5fc8dc3a7
Introduce the CWD macro in test output asserting
Avoids dealing with things like CWD changing.
2018-08-30 11:05:29 +02:00
Dale Wijnand
570fe8927d
Remove hamcrest existing_file() 2018-08-29 10:26:12 +02:00
Dale Wijnand
66262110a2
Replace .exec_with_output() usage with .run() 2018-08-29 00:45:18 +02:00
Dale Wijnand
21d9c4ae89
Replace some bare ProcessBuilder usage with Execs 2018-08-28 23:05:39 +02:00
Dale Wijnand
2554afe764
Make Project::process return Execs 2018-08-28 22:38:26 +02:00
Dale Wijnand
85984a8700
Migrate from tests fom assert_that/execs to .run() 2018-08-28 15:08:12 +02:00
Dale Wijnand
b5ee3635ef
Wrap ProcessBuilder in Execs & make .cargo return that 2018-08-28 09:24:37 +01:00
Alex Crichton
a0591eeac1 Add a configuration option to fetch with git-the-CLI
Currently Cargo always uses `libgit2` to perform all fetches of git
repositories, but sometimes this is not sufficient. The `libgit2` library
doesn't support all authentication schemes that `git` does and it isn't always
quite at feature parity with `git` itself, especially in terms of network
configuration.

This commit adds a configuration option to Cargo for fetching git repositories
with the `git` CLI tool rather than the internal `libgit2`. While this exposes
us to changes over time in the `git` CLI it's hopefully a very targeted use case
that doesn't change much. The internal `libgit2` library should be sufficient
for all other forms of git repository management. (and using `git` for only
fetches shouldn't slow us down much)

The new configuration option in `.cargo/config` is:

    [net]
    git-fetch-with-cli = true

which can also be specified with `CARGO_NET_GIT_FETCH_WITH_CLI=true` via an
environment variable.

Closes #5903
2018-08-21 09:09:20 -07: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