|
1 | 1 | //! Tests for setting custom rustc flags.
|
2 | 2 |
|
3 | 3 | 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}; |
7 | 5 | use std::fs;
|
8 | 6 |
|
9 | 7 | #[cargo_test]
|
@@ -114,76 +112,6 @@ fn env_rustflags_build_script_dep() {
|
114 | 112 | foo.cargo("check").env("RUSTFLAGS", "--cfg foo").run();
|
115 | 113 | }
|
116 | 114 |
|
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 |
| - |
187 | 115 | #[cargo_test]
|
188 | 116 | fn env_rustflags_normal_source_with_target() {
|
189 | 117 | let p = project()
|
@@ -505,90 +433,6 @@ fn build_rustflags_build_script_dep() {
|
505 | 433 | foo.cargo("check").run();
|
506 | 434 | }
|
507 | 435 |
|
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 |
| - |
592 | 436 | #[cargo_test]
|
593 | 437 | fn build_rustflags_normal_source_with_target() {
|
594 | 438 | let p = project()
|
|
0 commit comments