mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
test: show that -Awarnings
fails target info probing
This will be resolved in the next commit
This commit is contained in:
parent
4a88f924c6
commit
e57a2f43c2
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@ -161,6 +161,7 @@ jobs:
|
||||
- run: rustup update --no-self-update stable
|
||||
- run: rustup update --no-self-update ${{ matrix.rust }} && rustup default ${{ matrix.rust }}
|
||||
- run: rustup target add ${{ matrix.other }}
|
||||
- run: rustup target add wasm32-unknown-unknown
|
||||
- run: rustup target add aarch64-unknown-none # need this for build-std mock tests
|
||||
if: startsWith(matrix.rust, 'nightly')
|
||||
- run: rustup component add rustc-dev llvm-tools-preview rust-docs
|
||||
@ -225,6 +226,7 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
- run: rustup update --no-self-update stable && rustup default stable
|
||||
- run: rustup target add i686-unknown-linux-gnu
|
||||
- run: rustup target add wasm32-unknown-unknown
|
||||
- run: sudo apt update -y && sudo apt install gcc-multilib libsecret-1-0 libsecret-1-dev -y
|
||||
- run: rustup component add rustfmt || echo "rustfmt not available"
|
||||
- run: cargo test -p cargo
|
||||
|
@ -1260,3 +1260,38 @@ fn doctest_xcompile_linker() {
|
||||
"#]])
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn always_emit_warnings_as_warnings_when_learning_target_info() {
|
||||
if cross_compile::disabled() {
|
||||
return;
|
||||
}
|
||||
|
||||
let target = "wasm32-unknown-unknown";
|
||||
if !cross_compile::requires_target_installed(target) {
|
||||
return;
|
||||
}
|
||||
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
edition = "2015"
|
||||
"#,
|
||||
)
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
p.cargo("build -v --target")
|
||||
.env("RUSTFLAGS", "-Awarnings")
|
||||
.arg(target)
|
||||
.with_status(101)
|
||||
.with_stderr_data(str![[r#"
|
||||
[ERROR] output of --print=file-names missing when learning about target-specific information from rustc
|
||||
command was: `rustc - --crate-name ___ --print=file-names -Awarnings --target wasm32-unknown-unknown --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg`
|
||||
...
|
||||
"#]])
|
||||
.run();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user