-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flags from custom build script are now used
- Loading branch information
1 parent
34ace11
commit f888b4b
Showing
2 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
use std::path; | ||
|
||
use support::{project, execs}; | ||
use support::{COMPILING, RUNNING}; | ||
use hamcrest::{assert_that}; | ||
|
||
fn setup() { | ||
|
@@ -151,3 +154,55 @@ Only `-l` and `-L` flags are allowed in build script of `foo v0.5.0 (file://{})` | |
`", | ||
p.root().display()))); | ||
}) | ||
|
||
/* | ||
test!(custom_build_script_rustc_flags { | ||
let p = project("foo") | ||
.file("Cargo.toml", r#" | ||
[project] | ||
name = "bar" | ||
version = "0.5.0" | ||
authors = ["[email protected]"] | ||
[dependencies.foo] | ||
path = "foo" | ||
"#) | ||
.file("src/main.rs", r#" | ||
fn main() {} | ||
"#) | ||
.file("foo/Cargo.toml", r#" | ||
[project] | ||
name = "foo" | ||
version = "0.5.0" | ||
authors = ["[email protected]"] | ||
build = "build.rs" | ||
"#) | ||
.file("foo/src/lib.rs", r#" | ||
"#) | ||
.file("foo/build.rs", r#" | ||
fn main() { | ||
println!("cargo:rustc-flags=-l nonexistinglib -L /dummy/path1 -L /dummy/path2"); | ||
} | ||
"#); | ||
// TODO: TEST FAILS BECAUSE OF WRONG STDOUT (but otherwise, the build works) | ||
assert_that(p.cargo_process("build").arg("--verbose"), | ||
execs().with_status(101) | ||
.with_stdout(format!("\ | ||
{compiling} bar v0.5.0 ({url}) | ||
{running} `rustc {dir}{sep}src{sep}lib.rs --crate-name test --crate-type lib -g \ | ||
-C metadata=[..] \ | ||
-C extra-filename=-[..] \ | ||
--out-dir {dir}{sep}target \ | ||
--dep-info [..] \ | ||
-L {dir}{sep}target \ | ||
-L {dir}{sep}target{sep}deps` | ||
", | ||
running = RUNNING, compiling = COMPILING, sep = path::SEP, | ||
dir = p.root().display(), | ||
url = p.url(), | ||
))); | ||
}) | ||
*/ |