Commit graph

59 commits

Author SHA1 Message Date
Dale Wijnand 494fdabe2f
If creating a new GitSource, updating it is required before querying it 2018-09-20 11:10:24 +01: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
bors 5984312202 Auto merge of #5990 - dwijnand:no-crates.io-index-url, r=alexcrichton
Don't print crates.io-index URL when Updating

Following the lead from PackageId's Display, only display the registry's
URL if it's not the default registry (aka crates.io).

Before:

    $ cargo install lazy_static
        Updating registry `https://github.com/rust-lang/crates.io-index`

After:

    $ dcargo install lazy_static
        Updating crates.io index

Fixes #4208
2018-09-09 21:06:13 +00: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
Dale Wijnand 3b786a0dfd
Simplify test::install_ignores_cargo_config 2018-09-06 07:37:01 +01:00
Dale Wijnand d036024000
Fix change in install::install_ignores_cargo_config 2018-09-06 07:36:54 +01:00
Dale Wijnand 4415c72828
Remove/reworksome redundant .cwd(p.root()) in tests 2018-09-06 01:12:53 +01:00
Matthias Krüger 2cd9cce6e3 clippy: resolve all warnings about useless format!() 2018-09-03 11:38:29 +02:00
Jorge Aparicio 942e3672a6 fix unit test 2018-09-01 18:16:49 +02:00
Jorge Aparicio e53d31ed91 fix test source 2018-09-01 18:12:22 +02:00
Jorge Aparicio e620865633 make cargo install ignore .cargo/config
closes #5850
2018-09-01 18:12:22 +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 f009dc4e1b
Remove hamcrest has_installed_exe & is_not 2018-08-29 10:26:12 +02:00
Dale Wijnand 6fd1b54c65
Remove hamcrest existing_dir() 2018-08-29 07:53:01 +02:00
Dale Wijnand 85984a8700
Migrate from tests fom assert_that/execs to .run() 2018-08-28 15:08:12 +02:00
bors 8537ab9131 Auto merge of #5927 - dwijnand:uninstall-cwd, r=ehuss
Make "cargo uninstall" uninstall the cwd bins

Fixes #5916

Tested with a local build of cargo, using coreutils:

    17:33:57 $ dcargo uninstall
    Removing /Users/dnw/.cargo/bin/uutils
2018-08-23 16:25:14 +00:00
Dale Wijnand d87951aa73
Handle Window's missing file error message 2018-08-23 15:05:49 +01:00
Dale Wijnand 8921abd791
Make "cargo uninstall" uninstall the cwd bins 2018-08-23 10:57:36 +01:00
Dale Wijnand fc93b0f941
Improve the cargo install deprecation messaging 2018-08-22 09:46:50 +01:00
Dale Wijnand 16aeb0cd4f
Default test support's Execs to exit code 0 2018-08-03 07:44:42 +01:00
Dale Wijnand f88ff968ed
Fix install_empty_argument by passing an empty arg 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
Dale Wijnand 2fe2ea9e71
Use p.cargo's ability to split on whitespace more 2018-08-02 15:18:44 +01:00
Dale Wijnand ca7d9ee292
Declare one-line files on one line, in test projects 2018-07-25 09:58:50 +01:00
Dale Wijnand ab19c48358
Dedup a bunch more manifest 2018-07-25 00:43:30 +01:00
Dale Wijnand 081e7930d2
Drop now unnecessary basic manifests 2018-07-24 16:33:55 +01:00
Dale Wijnand 43b42d6f4c
Reorganise the testsuite crate module hierarchy
* Collapse the nested cargotest::support module into the cargotest
  module (merge the mod.rs's)
* Rename the cargotest module to support
* Nest the top-level hamcrest module into support
2018-07-22 08:46:44 +01:00
Dale Wijnand 7fe2fbc8a3
Remove the argument from the project test support function
By rewriting the tests, with rerast (https://github.com/google/rerast),
to use the newly introduced "at" method.

First I added the following temporary function to cargotest::support:

    pub fn project_foo() -> ProjectBuilder {
        project("foo")
    }

Then I defined the following rewrite.rs:

    use cargotest::support::{ project, project_foo };

    fn rule1(a: &'static str) {
        replace!(project("foo") => project_foo());
        replace!(project(a) => project_foo().at(a));
    }

Then I ran rerast:

    cargo +nightly rerast --rules_file=rewrite.rs --force --targets tests --file tests/testsuite/main.rs

Finally I searched and replaced the references to project_foo with
argument-less project (a little awkardly on macOS with a git clean).

    find tests -type f -exec sed -i -e 's/project_foo/project/g' {} +
    git clean -d tests
2018-07-20 13:31:50 +01:00
Alex Crichton d1ef031a62 Fix cargo install using a workspace target dir
Closes #5662
2018-07-05 12:06:26 -07:00
Ximin Luo 0774e97da3 Support cross-compile install 2018-06-28 18:57:24 -07:00
Ximin Luo 3b94f44ec4 Revert "cargo install will ignore the target triple specified in a project directory"
This reverts commit 1bad99180a.
2018-06-28 18:34:12 -07:00
bors 561beb22d2 Auto merge of #5606 - vramana:fix/cargo-install, r=alexcrichton
`cargo install` will ignore the target triple specified in a project directory

Fixes #5441
2018-06-27 16:10:08 +00:00
Ramana Venkata 1bad99180a cargo install will ignore the target triple specified in a project directory
Fixes #5441
2018-06-17 19:49:31 +05:30
Aleksey Kladov 1c15c722fe Install pre-release versions by default for git deps
closes #5627
2018-06-11 21:47:09 +03:00
Mateusz Mikuła 059107e1a0 Always replace metadata when replacing package
Fixes https://github.com/rust-lang/cargo/issues/4582
2018-05-25 14:37:40 +02:00
Alex Crichton 8413008937 Rename the rust manifest key to edition
This'll hopefully jive better with the terminology of "edition" throughout the
rest of Rust!
2018-05-03 11:45:04 -07:00
Aleksey Kladov 658343aa10 Don't install pre-releases by default 2018-05-03 01:32:06 +03:00
Dirkjan Ochtman 5c241e1027 Correct formatting with cargo fmt 2018-04-11 23:16:17 +02:00
Dale Wijnand 3ba58ae987
add the inverse is_not has_installed_exe assertion 2018-04-10 15:13:26 +01:00
Dale Wijnand e201a8949c
warn in 2015, error in 2018 2018-04-10 15:10:38 +01:00
Dale Wijnand 6086f26f91
enable cargo edition feature & bump to 2018 2018-04-10 06:44:59 +01:00
Dale Wijnand 4676820fea
Warn about cargo installing the cwd in 2018 edition
Fixes #5327
2018-04-10 01:37:12 +01:00
Lukas Lueg 81ed0620bc Assert that Dependency::name is never empty, prevent 'install ""' from crashing
An explicit `cargo install ""` would cause clap to pass an empty crate-name,
leading to a panic(). We now assert() that Dependency::name is never the
empty string and prevent the situation in the first place by not allowing
the crate-name to be empty for `install`.

Fixes #5229
2018-03-23 16:07:01 +01:00
Ximin Luo 89d274875f Revert "Work around #5134 for now"
This reverts commit d46db71b3f.
2018-03-15 17:05:13 +01:00
Aleksey Kladov b0c181d91c Prettify rustfmted single-line strings 2018-03-14 17:48:44 -07:00
Alex Crichton 1e6828485e cargo fmt 2018-03-14 17:48:23 -07:00
Aleksey Kladov 16bde4e0ae Unwind stack for cli errors 2018-03-09 10:43:00 +03:00
Aleksey Kladov 0470d77575 Support list subcommand
All tests are green 🎉
2018-03-08 23:31:56 +03:00