Commit graph

52 commits

Author SHA1 Message Date
Ed Page
675224b3a0 test(config): Shift to config.toml 2024-01-26 13:40:46 -06:00
Scott Schafer
0d62ae2fc3
feat: Add rustc style errors for manifest parsing 2023-12-15 13:30:10 -07:00
hi-rustin
e540c66e09 Remove the deleted feature test_2018_feature from the test
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-12-12 10:54:29 +08:00
Ed Page
51aeeb01ff fix(cli): Provide next steps for bad -Z flag
In #5546, they suggested we have a list of them but that would be hard
to keep up and works well enough to just always mention it.

Fixes #5546
2023-10-19 09:29:05 -05:00
Ed Page
53dcd2f454 fix(manifest): Provide more context on sematic errors 2023-08-24 16:27:53 -05:00
Ed Page
8927ea99d1 refactor(manifest): Process the package.cargo-features error in serde 2023-08-24 16:27:45 -05:00
Eric Huss
1df0f1d734 Add allow(internal_features) 2023-08-05 12:11:07 -07:00
Eric Huss
3c295cf5ec Update tests for publish text changes 2023-03-15 08:50:11 -07:00
hi-rustin
0b06a456f2 Make blocking tests non blocking 2023-02-23 09:11:52 +08:00
hi-rustin
04d592c7ad Make some blocking tests non-blocking by using API server 2023-02-23 09:11:52 +08:00
Scott Schafer
c10a4c60c5 chore: update cargo_features tests to use check 2023-02-20 12:20:26 -06:00
Arlo Siemsen
7cd613773d Fix several tests that are waiting 60 seconds for publishing to time out 2022-11-17 15:54:24 -06:00
Arlo Siemsen
dd5134c7a5 Implement RFC 3289: source replacement ambiguity 2022-10-07 22:30:59 -05:00
Eric Huss
1c3640e05c Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
Scott Schafer
c239e407e7 add a reason to masquerade_as_nightly_cargo so it is searchable 2022-07-15 21:32:23 -05:00
hi-rustin
5ccb5a3f92 Refine name
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-07-25 00:35:09 +08:00
hi-rustin
10cfa40669 Better msg for wrong position
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2021-07-24 10:44:44 +08:00
Weihang Lo
8c75e2ffa0
Update tests to use registry names 2021-07-22 00:50:30 +08:00
Eric Huss
2c99f654c9 Update nightly failure notification. 2021-07-05 16:08:36 -07:00
Jon Gjengset
8d79a75b31 Don't use RUSTC_BOOTSTRAP for nightly-only tests 2021-04-01 10:39:07 -07:00
Jon Gjengset
3b23a37acc Future-proof tests 2021-03-31 12:39:19 -07:00
Jon Gjengset
be333390a4 Print features without Debug 2021-03-31 12:39:09 -07:00
Jon Gjengset
85f7c800f8 Forward -Zallow-features to rustc 2021-03-24 10:14:53 -07:00
Jon Gjengset
caca4d43a0 Test that allowed-features in config works 2021-03-24 09:42:36 -07:00
Jon Gjengset
4a90ab6910 Add -Zallow-features to match rustc's -Z 2021-03-17 15:23:48 -07:00
Eric Huss
7bbef3defe Rework cargo-features a little.
* Add `removed` support.
* Include the version where it is stabilized.
* Include a links to the documentation in the error/warning messages.
2021-01-21 12:16:35 -08:00
Eric Huss
00615fc51a Add more helpful message with stabilized -Z flags.
Previously, when something was stabilized, Cargo would spit out a very
unhelpful error message about an unknown -Z flag. This changes it so
that it displays a helpful warning (or error).
2021-01-20 19:46:50 -08:00
Eric Huss
d89a78ee19 Add error message for wrong cargo-features placement.
This is intended to help if the user puts cargo-features in the
wrong place in Cargo.toml.
2021-01-20 19:22:51 -08: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
b4c374039f Do not implicitly load registry.token with --index.
The intent is to avoid leaking the crates.io token to other servers.
2020-04-19 09:20:54 -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
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
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
35b843ef30 Add some help and documentation for unstable flags. 2019-03-28 15:22:59 -07:00
Eric Huss
b5144c7f83 Add test for publish with [patch] + cleanup. 2019-01-11 19:14:58 -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
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
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
16aeb0cd4f
Default test support's Execs to exit code 0 2018-08-03 07:44: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
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
Aleksey Kladov
39a3709dcc Allow publishing crates with nightly features 2018-06-03 10:25:05 +03:00
Aleksey Kladov
b0c181d91c Prettify rustfmted single-line strings 2018-03-14 17:48:44 -07:00