mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-25 11:14:46 +00:00
test(build-analysis): feature gate tests
This commit is contained in:
parent
57fd10126c
commit
973f7410a8
43
tests/testsuite/build_analysis.rs
Normal file
43
tests/testsuite/build_analysis.rs
Normal file
@ -0,0 +1,43 @@
|
||||
//! Tests for `-Zbuild-analysis`.
|
||||
|
||||
use crate::prelude::*;
|
||||
|
||||
use cargo_test_support::basic_manifest;
|
||||
use cargo_test_support::project;
|
||||
use cargo_test_support::str;
|
||||
|
||||
#[cargo_test]
|
||||
fn gated() {
|
||||
let p = project()
|
||||
.file("Cargo.toml", &basic_manifest("foo", "0.0.0"))
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
p.cargo("check")
|
||||
.env("CARGO_BUILD_ANALYSIS_ENABLED", "true")
|
||||
.masquerade_as_nightly_cargo(&["build-analysis"])
|
||||
.with_stderr_data(str![[r#"
|
||||
[CHECKING] foo v0.0.0 ([ROOT]/foo)
|
||||
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
|
||||
|
||||
"#]])
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn simple() {
|
||||
let p = project()
|
||||
.file("Cargo.toml", &basic_manifest("foo", "0.0.0"))
|
||||
.file("src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
p.cargo("check -Zbuild-analysis")
|
||||
.env("CARGO_BUILD_ANALYSIS_ENABLED", "true")
|
||||
.masquerade_as_nightly_cargo(&["build-analysis"])
|
||||
.with_stderr_data(str![[r#"
|
||||
[CHECKING] foo v0.0.0 ([ROOT]/foo)
|
||||
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
|
||||
|
||||
"#]])
|
||||
.run();
|
||||
}
|
@ -11,6 +11,7 @@ mod bad_manifest_path;
|
||||
mod bench;
|
||||
mod binary_name;
|
||||
mod build;
|
||||
mod build_analysis;
|
||||
mod build_dir;
|
||||
mod build_plan;
|
||||
mod build_script;
|
||||
|
Loading…
x
Reference in New Issue
Block a user