Commit graph

49 commits

Author SHA1 Message Date
Ed Page
675224b3a0 test(config): Shift to config.toml 2024-01-26 13:40:46 -06:00
MarcusGrass
03675ef6a4
Add additional info on a new line 2023-06-05 11:27:31 +02:00
MarcusGrass
073a32b61f
Add message on reusing previous temporary path on failed cargo installs 2023-06-04 18:31:06 +02:00
Scott Schafer
76bb60cec7 chore: update directory tests to use check 2023-02-20 12:21:15 -06:00
Weihang Lo
8c75e2ffa0
Update tests to use registry names 2021-07-22 00:50:30 +08:00
gilescope
dc0e53b7c1
Reworking message to not care about an intial offset 2021-07-10 15:07:29 +01:00
Rémi Verschelde
0a40a0aea4
Replace deprecated [replace] references with [patch]
Cf. #7092.
2021-06-02 12:30:56 +02:00
Eric Huss
6f8c7d5a87 Normalize raw string indentation. 2020-09-26 17:59:58 -07:00
Alex Crichton
6514c289d2 Improve git error messages a bit
This commit is targeted at further improving the error messages
generated from git errors. For authentication errors the actual URL
fetched is now printed out as well if it's different from the original
URL. This should help handle `insteadOf` logic where SSH urls are used
instead of HTTPS urls and users can know to track that down.

Otherwise the logic about recommending `net.git-fetch-with-cli` was
tweaked a bit and moved to the same location as the rest of our error
reporting.

Note that a change piggy-backed here as well is that `Caused by:` errors
are now automatically all tabbed over a bit instead of only having the
first line tabbed over. This required a good number of tests to be
updated, but it's just an updated in renderings.
2020-06-25 08:47:15 -07:00
Eric Huss
4ae79d2ffd Use fs helpers instead of File functions. 2020-04-17 07:56:16 -07: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
Eric Huss
83571aee56 Minor testsuite organization. 2019-11-24 18:42:45 -08: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
Eric Huss
3c20a24335 Clean up some git test support functions. 2019-08-12 22:25:36 -07: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
Eric Huss
e023a6672b Add install-upgrade. 2019-04-02 08:40:34 -07:00
Eric Huss
ef0b47769b Cleanup: Remove unnecessary borrows. 2019-03-26 18:09:56 -07:00
Eric Huss
e7124ba262 Testsuite: Make cwd() relative to project root.
It's a fairly common pattern, and it seemed natural to me.
2019-03-20 16:34:56 -07:00
Alexander Regueiro
f7c91ba622
Various cosmetic improvements. 2019-02-20 10:58:27 +00:00
Dale Wijnand
37df042ba8
Test cleanup: remove unnecessary with_status(0) 2019-02-04 18:52:33 +01:00
Alik Aslanyan
67dbfe536d Perhaps you meant: bar, foo or foobar 2019-01-19 17:33:51 +04:00
Alex Crichton
b8b7faee50 Run cargo fix --edition-idioms and fixup output
This gets Cargo passing the `--edition-idioms` lints and more down the
road of the 2018 edition!
2018-12-11 05:45:46 -08: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
Alex Crichton
20cfb41e42 Try to improve "version not found" error
This commit tweaks the wording for when versions aren't found in a
source, notably including more location information other than the
source id but rather also taking into account replaced sources and such.
It's hoped that this gives more information to make it a bit more clear
what's going on.

Closes #6111
2018-10-02 13:18:35 -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
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
85984a8700
Migrate from tests fom assert_that/execs to .run() 2018-08-28 15:08:12 +02:00
Alex Crichton
6e57be5160 Only use non-absolute paths for path dependencies
Previously Cargo would use a non-absolute path for any dependency contained
within the workspace root but this switches Cargo to only using relative paths
for `path` dependencies. In practice this shouldn't make much difference, but
for vendored crates and moving around `CARGO_HOME` it can produce more
consistent results when target directories are shared.

Closes #5923
2018-08-24 11:02:13 -07:00
Dale Wijnand
16aeb0cd4f
Default test support's Execs to exit code 0 2018-08-03 07:44:42 +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
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
252f6e8e9f
Opt-out all other failing tests
Looks like cargo traverses the filesystem & fails if it runs into a
Cargo.toml that doesn't declare a target.  I couldn't find a nice way to
re-engineer the test to avoid this issue.  So I'll leave that as someone
else's exercise.
2018-07-24 13:59:42 +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
f8c9928cc1
Rework some test projects to use the "foo" default
Generally that means either switching "foo" and "bar" around (reversing
the arrow), or it means push "foo" to "bar" (and sometimes "bar" to
"baz", etc..) to free up "foo".

For trivia that leaves 80/1222 outliers, therefore 93.4% of test
project use the default. :)
2018-07-21 19:40:45 +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
Eh2406
98e1bdb762 oops... 2018-07-13 18:05:24 -04:00
Eh2406
3f5036ae4d update test to get ci passing 2018-07-11 23:26:01 -04:00
Lukas Kalbertodt
357281374d Adjust tests to new time output format 2018-05-02 18:34:59 +02:00
Alex Crichton
1e6828485e cargo fmt 2018-03-14 17:48:23 -07:00
Eh2406
0247dc429a intellij rust suggested fixes
(cherry picked from commit 24836e9)
2018-02-26 17:29:17 -05:00
André Rocha
c2ff988c9f Reorganize integration tests as one crate with many modules. Issue #4867. 2018-02-21 13:33:51 -05:00
Renamed from tests/directory.rs (Browse further)