From d0dbe63cbf58dff545302151fb1b6391ecfb6d44 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Wed, 23 Nov 2022 22:23:37 +0000 Subject: [PATCH] remove 2 tests 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. --- tests/testsuite/build_script.rs | 61 ------------------------------- tests/testsuite/features2.rs | 65 --------------------------------- 2 files changed, 126 deletions(-) diff --git a/tests/testsuite/build_script.rs b/tests/testsuite/build_script.rs index a6b93b7c38b3..151792c9b2dd 100644 --- a/tests/testsuite/build_script.rs +++ b/tests/testsuite/build_script.rs @@ -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() diff --git a/tests/testsuite/features2.rs b/tests/testsuite/features2.rs index 6103e4bd5d45..e1d9139dcf70 100644 --- a/tests/testsuite/features2.rs +++ b/tests/testsuite/features2.rs @@ -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"