Skip to content

Commit feda71e

Browse files
committed
delete and change more tests
1 parent 688f37c commit feda71e

File tree

4 files changed

+3
-165
lines changed

4 files changed

+3
-165
lines changed

src/cargo/util/toml/targets.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -841,11 +841,8 @@ fn configure(toml: &TomlTarget, target: &mut Target) -> CargoResult<()> {
841841
Some(false) => RustdocScrapeExamples::Disabled,
842842
Some(true) => RustdocScrapeExamples::Enabled,
843843
})
844-
.set_for_host(match toml.proc_macro() {
845-
None => t2.for_host(),
846-
Some(true) => true,
847-
Some(false) => false,
848-
});
844+
.set_for_host(toml.proc_macro().unwrap_or_else(t2.for_host()));
845+
849846
if let Some(edition) = toml.edition.clone() {
850847
target.set_edition(
851848
edition

tests/testsuite/build_script.rs

-1
Original file line numberDiff line numberDiff line change
@@ -2221,7 +2221,6 @@ fn transitive_dep_host() {
22212221
22222222
[lib]
22232223
name = "b"
2224-
plugin = true
22252224
22262225
[dependencies.a]
22272226
path = "../a"

tests/testsuite/cross_compile.rs

-2
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,6 @@ fn plugin_build_script_right_arch() {
901901
902902
[lib]
903903
name = "foo"
904-
plugin = true
905904
"#,
906905
)
907906
.file("build.rs", "fn main() {}")
@@ -912,7 +911,6 @@ fn plugin_build_script_right_arch() {
912911
.arg(cross_compile::alternate())
913912
.with_stderr(
914913
"\
915-
[WARNING] unused manifest key: lib.plugin
916914
[COMPILING] foo v0.0.1 ([..])
917915
[RUNNING] `rustc [..] build.rs [..]`
918916
[RUNNING] `[..]/build-script-build`

tests/testsuite/rustflags.rs

+1-157
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
//! Tests for setting custom rustc flags.
22
33
use cargo_test_support::registry::Package;
4-
use cargo_test_support::{
5-
basic_lib_manifest, basic_manifest, paths, project, project_in_home, rustc_host,
6-
};
4+
use cargo_test_support::{basic_manifest, paths, project, project_in_home, rustc_host};
75
use std::fs;
86

97
#[cargo_test]
@@ -114,76 +112,6 @@ fn env_rustflags_build_script_dep() {
114112
foo.cargo("check").env("RUSTFLAGS", "--cfg foo").run();
115113
}
116114

117-
#[cargo_test]
118-
fn env_rustflags_plugin() {
119-
// RUSTFLAGS should be passed to rustc for plugins
120-
// when --target is not specified.
121-
// In this test if --cfg foo is not passed the build will fail.
122-
let p = project()
123-
.file(
124-
"Cargo.toml",
125-
r#"
126-
[package]
127-
name = "foo"
128-
version = "0.0.1"
129-
130-
[lib]
131-
name = "foo"
132-
plugin = true
133-
"#,
134-
)
135-
.file(
136-
"src/lib.rs",
137-
r#"
138-
fn main() { }
139-
#[cfg(not(foo))]
140-
fn main() { }
141-
"#,
142-
)
143-
.build();
144-
145-
p.cargo("check").env("RUSTFLAGS", "--cfg foo").run();
146-
}
147-
148-
#[cargo_test]
149-
fn env_rustflags_plugin_dep() {
150-
// RUSTFLAGS should be passed to rustc for plugins
151-
// when --target is not specified.
152-
// In this test if --cfg foo is not passed the build will fail.
153-
let foo = project()
154-
.file(
155-
"Cargo.toml",
156-
r#"
157-
[package]
158-
name = "foo"
159-
version = "0.0.1"
160-
161-
[lib]
162-
name = "foo"
163-
plugin = true
164-
165-
[dependencies.bar]
166-
path = "../bar"
167-
"#,
168-
)
169-
.file("src/lib.rs", "fn foo() {}")
170-
.build();
171-
let _bar = project()
172-
.at("bar")
173-
.file("Cargo.toml", &basic_lib_manifest("bar"))
174-
.file(
175-
"src/lib.rs",
176-
r#"
177-
fn bar() { }
178-
#[cfg(not(foo))]
179-
fn bar() { }
180-
"#,
181-
)
182-
.build();
183-
184-
foo.cargo("check").env("RUSTFLAGS", "--cfg foo").run();
185-
}
186-
187115
#[cargo_test]
188116
fn env_rustflags_normal_source_with_target() {
189117
let p = project()
@@ -505,90 +433,6 @@ fn build_rustflags_build_script_dep() {
505433
foo.cargo("check").run();
506434
}
507435

508-
#[cargo_test]
509-
fn build_rustflags_plugin() {
510-
// RUSTFLAGS should be passed to rustc for plugins
511-
// when --target is not specified.
512-
// In this test if --cfg foo is not passed the build will fail.
513-
let p = project()
514-
.file(
515-
"Cargo.toml",
516-
r#"
517-
[package]
518-
name = "foo"
519-
version = "0.0.1"
520-
521-
[lib]
522-
name = "foo"
523-
plugin = true
524-
"#,
525-
)
526-
.file(
527-
"src/lib.rs",
528-
r#"
529-
fn main() { }
530-
#[cfg(not(foo))]
531-
fn main() { }
532-
"#,
533-
)
534-
.file(
535-
".cargo/config.toml",
536-
r#"
537-
[build]
538-
rustflags = ["--cfg", "foo"]
539-
"#,
540-
)
541-
.build();
542-
543-
p.cargo("check").run();
544-
}
545-
546-
#[cargo_test]
547-
fn build_rustflags_plugin_dep() {
548-
// RUSTFLAGS should be passed to rustc for plugins
549-
// when --target is not specified.
550-
// In this test if --cfg foo is not passed the build will fail.
551-
let foo = project()
552-
.file(
553-
"Cargo.toml",
554-
r#"
555-
[package]
556-
name = "foo"
557-
version = "0.0.1"
558-
559-
[lib]
560-
name = "foo"
561-
plugin = true
562-
563-
[dependencies.bar]
564-
path = "../bar"
565-
"#,
566-
)
567-
.file("src/lib.rs", "fn foo() {}")
568-
.file(
569-
".cargo/config.toml",
570-
r#"
571-
[build]
572-
rustflags = ["--cfg", "foo"]
573-
"#,
574-
)
575-
.build();
576-
let _bar = project()
577-
.at("bar")
578-
.file("Cargo.toml", &basic_lib_manifest("bar"))
579-
.file(
580-
"src/lib.rs",
581-
r#"
582-
fn bar() { }
583-
#[cfg(not(foo))]
584-
fn bar() { }
585-
"#,
586-
)
587-
.build();
588-
589-
foo.cargo("check").run();
590-
}
591-
592436
#[cargo_test]
593437
fn build_rustflags_normal_source_with_target() {
594438
let p = project()

0 commit comments

Comments
 (0)