test: Migrate some files to snapbox#14069
Conversation
| [FINISHED] `test` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s | ||
| [DOCTEST] foo | ||
| [RUNNING] `rustdoc [..]--crate-name foo [..]-C link-arg=--this-is-a-bogus-flag[..] | ||
| [ERROR] doctest failed, to rerun pass `--doc` |
tests/testsuite/cache_messages.rs
Outdated
| .run(); | ||
| } | ||
|
|
||
| #[allow(deprecated)] |
There was a problem hiding this comment.
On account ofwith_stderr_does_not_contain(),added #[allow(deprecated)].
There was a problem hiding this comment.
It seems like we can just assert stdout with str![] to replace with_stderr_does_not_contain here. They should be all empty except the very first invocation.
And we can add str! for each with_stderr_data.
There was a problem hiding this comment.
You're right. The first one looks empty too.
There was a problem hiding this comment.
Sorry. FOund that I was wrong 🤦🏾♂️. WRAPPER CALLED: might be matched by ... wild card. We should keep with_stderr_does_not_contain. Maybe make the literal shorter so it won't accidentally mismatch in the future? Like with_stderr_does_not_contain("WRAPPER CALLED: [..])?
| .run(); | ||
| } | ||
|
|
||
| #[allow(deprecated)] |
There was a problem hiding this comment.
On account ofwith_stderr_does_not_contain(),added #[allow(deprecated)].
0d255dd to
0f4f256
Compare
tests/testsuite/cache_messages.rs
Outdated
| // Fill the cache. | ||
| p.cargo("check").with_stderr_contains("[..]asdf[..]").run(); | ||
| p.cargo("check") | ||
| .with_stderr_data( |
There was a problem hiding this comment.
While rustc invocation is omitted, I believe we can still wrap it with str![].
There was a problem hiding this comment.
Thanks, it has been modified.
BTW: Sorry, I'm a bit confused now, what are the criteria for using or not using str![]?
There was a problem hiding this comment.
See #14039 "4. Resolve non-literal deprecations".
To me, I try porting all of the with str![] unless it is too specific, fragile, or hard to model with str![].
05cfed0 to
b0f4c94
Compare
| "\ | ||
| [FRESH] foo v0.0.1 ([ROOT]/foo) | ||
| WRAPPER CALLED: rustc [..] | ||
| ... |
There was a problem hiding this comment.
This is not necessary and can be wrapped with str![]
| ... |
tests/testsuite/cache_messages.rs
Outdated
| .run(); | ||
| } | ||
|
|
||
| #[allow(deprecated)] |
There was a problem hiding this comment.
It seems like we can just assert stdout with str![] to replace with_stderr_does_not_contain here. They should be all empty except the very first invocation.
And we can add str! for each with_stderr_data.
b0f4c94 to
ebb795c
Compare
ebb795c to
2e1f7b4
Compare
|
Thanks. Looks good. @bors r+ |
|
☀️ Test successful - checks-actions |
Update cargo 13 commits in a1f47ec3f7cd076986f1bfcd7061f2e8cb1a726e..3ed207e416fb2f678a40cc79c02dcf4f936a21ce 2024-06-15 01:10:07 +0000 to 2024-06-18 19:18:22 +0000 - test: prefer raw string for regex reduction (rust-lang/cargo#14099) - test: migrate tree and tree_graph_features to snapbox (rust-lang/cargo#14094) - test: Migrate some files to snapbox (rust-lang/cargo#14069) - remove some legacy public dependency code from the resolver (rust-lang/cargo#14090) - fix(fix): Address problems with implicit -> explicit feature migration (rust-lang/cargo#14018) - refactor: 1.79 cleanup (rust-lang/cargo#14088) - test: migrate `git_(gc|shallow)` to snapbox (rust-lang/cargo#14087) - test: migrate timings_works to snapbox (rust-lang/cargo#14082) - test: migrate minimal_versions to snapbox (rust-lang/cargo#14080) - Remove `run_expect_error` to avoid tests incorrectly passing (rust-lang/cargo#14078) - test: migrate help to snapbox (rust-lang/cargo#14060) - test: Migrate tests/testsuite/co*.rs to snapbox (rust-lang/cargo#14079) - Use `std::fs::absolute` instead of reimplementing it (rust-lang/cargo#14075) <!-- r? ghost -->
What does this PR try to resolve?
This PR addresses the migration of the following files:
tests/testsuite/build_script_extra_link_arg.rstests/testsuite/cache_lock.rstests/testsuite/cache_messages.rspart of #14039