Skip to content

Commit

Permalink
remove 2 tests
Browse files Browse the repository at this point in the history
These 2 tests showcase some optimization between build time and runtime
unit sharing that is not applicable anymore with the general debuginfo
removal for all build dependencies.
  • Loading branch information
lqd committed Nov 23, 2022
1 parent 7f02ff0 commit d0dbe63
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 126 deletions.
61 changes: 0 additions & 61 deletions tests/testsuite/build_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4502,67 +4502,6 @@ fn optional_build_script_dep() {
p.cargo("run --features bar").with_stdout("1\n").run();
}

#[cargo_test]
fn optional_build_dep_and_required_normal_dep() {
let p = project()
.file(
"Cargo.toml",
r#"
[package]
name = "foo"
version = "0.1.0"
authors = []
[dependencies]
bar = { path = "./bar", optional = true }
[build-dependencies]
bar = { path = "./bar" }
"#,
)
.file("build.rs", "extern crate bar; fn main() { bar::bar(); }")
.file(
"src/main.rs",
r#"
#[cfg(feature = "bar")]
extern crate bar;
fn main() {
#[cfg(feature = "bar")] {
println!("{}", bar::bar());
}
#[cfg(not(feature = "bar"))] {
println!("0");
}
}
"#,
)
.file("bar/Cargo.toml", &basic_manifest("bar", "0.5.0"))
.file("bar/src/lib.rs", "pub fn bar() -> u32 { 1 }");
let p = p.build();

p.cargo("run")
.with_stdout("0")
.with_stderr(
"\
[COMPILING] bar v0.5.0 ([..])
[COMPILING] foo v0.1.0 ([..])
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
[RUNNING] `[..]foo[EXE]`",
)
.run();

p.cargo("run --all-features")
.with_stdout("1")
.with_stderr(
"\
[COMPILING] foo v0.1.0 ([..])
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
[RUNNING] `[..]foo[EXE]`",
)
.run();
}

#[cargo_test]
fn using_rerun_if_changed_does_not_rebuild() {
let p = project()
Expand Down
65 changes: 0 additions & 65 deletions tests/testsuite/features2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1047,71 +1047,6 @@ fn decouple_proc_macro() {
.exists());
}

#[cargo_test]
fn proc_macro_ws() {
// Checks for bug with proc-macro in a workspace with dependency (shouldn't panic).
let p = project()
.file(
"Cargo.toml",
r#"
[workspace]
members = ["foo", "pm"]
resolver = "2"
"#,
)
.file(
"foo/Cargo.toml",
r#"
[package]
name = "foo"
version = "0.1.0"
[features]
feat1 = []
"#,
)
.file("foo/src/lib.rs", "")
.file(
"pm/Cargo.toml",
r#"
[package]
name = "pm"
version = "0.1.0"
[lib]
proc-macro = true
[dependencies]
foo = { path = "../foo", features=["feat1"] }
"#,
)
.file("pm/src/lib.rs", "")
.build();

p.cargo("check -p pm -v")
.with_stderr_contains("[RUNNING] `rustc --crate-name foo [..]--cfg[..]feat1[..]")
.run();
// This may be surprising that `foo` doesn't get built separately. It is
// because pm might have other units (binaries, tests, etc.), and so the
// feature resolver must assume that normal deps get unified with it. This
// is related to the bigger issue where the features selected in a
// workspace depend on which packages are selected.
p.cargo("check --workspace -v")
.with_stderr(
"\
[FRESH] foo v0.1.0 [..]
[FRESH] pm v0.1.0 [..]
[FINISHED] dev [..]
",
)
.run();
// Selecting just foo will build without unification.
p.cargo("check -p foo -v")
// Make sure `foo` is built without feat1
.with_stderr_line_without(&["[RUNNING] `rustc --crate-name foo"], &["--cfg[..]feat1"])
.run();
}

#[cargo_test]
fn has_dev_dep_for_test() {
// Check for a bug where the decision on whether or not "dev dependencies"
Expand Down

0 comments on commit d0dbe63

Please sign in to comment.