Skip to content

Commit 742ccbd

Browse files
committed
Auto merge of #7208 - ehuss:fix-old-build-script-test, r=alexcrichton
Fix an old test. This test was added in f888b4b, part of #792, in a commented state. Might as well make it work. It is a bit surprising that passing `-l nonexistinglib` doesn't cause an error, but seems to be fine.
2 parents fe7b427 + 4a37adc commit 742ccbd

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

tests/testsuite/build_script.rs

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ fn custom_build_script_wrong_rustc_flags() {
195195
.run();
196196
}
197197

198-
/*
199198
#[cargo_test]
200199
fn custom_build_script_rustc_flags() {
201200
let p = project()
@@ -211,7 +210,8 @@ fn custom_build_script_rustc_flags() {
211210
[dependencies.foo]
212211
path = "foo"
213212
"#,
214-
).file("src/main.rs", "fn main() {}")
213+
)
214+
.file("src/main.rs", "fn main() {}")
215215
.file(
216216
"foo/Cargo.toml",
217217
r#"
@@ -222,33 +222,37 @@ fn custom_build_script_rustc_flags() {
222222
authors = ["[email protected]"]
223223
build = "build.rs"
224224
"#,
225-
).file("foo/src/lib.rs", "")
225+
)
226+
.file("foo/src/lib.rs", "")
226227
.file(
227228
"foo/build.rs",
228229
r#"
229230
fn main() {
230231
println!("cargo:rustc-flags=-l nonexistinglib -L /dummy/path1 -L /dummy/path2");
231232
}
232233
"#,
233-
).build();
234+
)
235+
.build();
234236

235-
// TODO: TEST FAILS BECAUSE OF WRONG STDOUT (but otherwise, the build works).
236237
p.cargo("build --verbose")
237-
.with_status(101)
238238
.with_stderr(
239239
"\
240-
[COMPILING] bar v0.5.0 ([CWD])
241-
[RUNNING] `rustc --crate-name test [CWD]/src/lib.rs --crate-type lib -C debuginfo=2 \
242-
-C metadata=[..] \
243-
-C extra-filename=-[..] \
244-
--out-dir [CWD]/target \
245-
--emit=[..]link \
246-
-L [CWD]/target \
247-
-L [CWD]/target/deps`
240+
[COMPILING] foo [..]
241+
[RUNNING] `rustc --crate-name build_script_build foo/build.rs [..]
242+
[RUNNING] `[..]build-script-build`
243+
[RUNNING] `rustc --crate-name foo foo/src/lib.rs [..]\
244+
-L dependency=[CWD]/target/debug/deps \
245+
-L /dummy/path1 -L /dummy/path2 -l nonexistinglib`
246+
[COMPILING] bar [..]
247+
[RUNNING] `rustc --crate-name bar src/main.rs [..]\
248+
-L dependency=[CWD]/target/debug/deps \
249+
--extern foo=[..]libfoo-[..] \
250+
-L /dummy/path1 -L /dummy/path2`
251+
[FINISHED] dev [..]
248252
",
249-
).run();
253+
)
254+
.run();
250255
}
251-
*/
252256

253257
#[cargo_test]
254258
fn links_no_build_cmd() {

0 commit comments

Comments
 (0)