mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00
Add tests
This commit is contained in:
parent
872aa8f4f7
commit
af46bbd264
@ -611,6 +611,81 @@ fn strip_accepts_false_to_disable_strip() {
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn strip_debuginfo_in_release() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.1.0"
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
p.cargo("build --release -v")
|
||||
.with_stderr_contains("[RUNNING] `rustc [..] -C strip=debuginfo[..]`")
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn strip_debuginfo_without_debug() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.1.0"
|
||||
|
||||
[profile.dev]
|
||||
debug = 0
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.build();
|
||||
|
||||
p.cargo("build -v")
|
||||
.with_stderr_contains("[RUNNING] `rustc [..] -C strip=debuginfo[..]`")
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn do_not_strip_debuginfo_with_requested_debug() {
|
||||
let p = project()
|
||||
.file(
|
||||
"Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.1.0"
|
||||
|
||||
[dependencies]
|
||||
bar = { path = "bar" }
|
||||
|
||||
[profile.release.package.bar]
|
||||
debug = 1
|
||||
"#,
|
||||
)
|
||||
.file("src/main.rs", "fn main() {}")
|
||||
.file(
|
||||
"bar/Cargo.toml",
|
||||
r#"
|
||||
[package]
|
||||
name = "bar"
|
||||
verison = "0.1.0"
|
||||
"#,
|
||||
)
|
||||
.file("bar/src/lib.rs", "")
|
||||
.build();
|
||||
|
||||
p.cargo("build --release -v")
|
||||
.with_stderr_does_not_contain("[RUNNING] `rustc [..] -C strip=debuginfo[..]`")
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cargo_test]
|
||||
fn rustflags_works() {
|
||||
let p = project()
|
||||
|
Loading…
x
Reference in New Issue
Block a user