-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate runmake tests away from custom commands and
command_output
- Loading branch information
Showing
30 changed files
with
176 additions
and
141 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
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
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
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
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,11 +1,13 @@ | ||
// Test that `-Awarnings` suppresses warnings for unstable APIs. | ||
|
||
use run_make_support::{assert_not_contains, rustc}; | ||
use run_make_support::rustc; | ||
|
||
fn main() { | ||
rustc().input("bar.rs").run(); | ||
let output = rustc().input("foo.rs").arg("-Awarnings").run(); | ||
|
||
assert_not_contains(&String::from_utf8(output.stdout).unwrap(), "warning"); | ||
assert_not_contains(&String::from_utf8(output.stderr).unwrap(), "warning"); | ||
rustc() | ||
.input("foo.rs") | ||
.arg("-Awarnings") | ||
.run() | ||
.assert_stdout_not_contains("warning") | ||
.assert_stderr_not_contains("warning"); | ||
} |
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
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,22 +1,21 @@ | ||
use std::process::Output; | ||
|
||
use run_make_support::{bin_name, rust_lib_name, rustc}; | ||
|
||
fn compare_stdout<S: AsRef<str>>(output: Output, expected: S) { | ||
assert_eq!(String::from_utf8(output.stdout).unwrap().trim(), expected.as_ref()); | ||
} | ||
|
||
fn main() { | ||
compare_stdout(rustc().print("crate-name").input("crate.rs").run(), "foo"); | ||
compare_stdout(rustc().print("file-names").input("crate.rs").run(), bin_name("foo")); | ||
compare_stdout( | ||
rustc().print("file-names").crate_type("lib").arg("--test").input("crate.rs").run(), | ||
bin_name("foo"), | ||
); | ||
compare_stdout( | ||
rustc().print("file-names").arg("--test").input("lib.rs").run(), | ||
bin_name("mylib"), | ||
); | ||
compare_stdout(rustc().print("file-names").input("lib.rs").run(), rust_lib_name("mylib")); | ||
compare_stdout(rustc().print("file-names").input("rlib.rs").run(), rust_lib_name("mylib")); | ||
rustc().print("crate-name").input("crate.rs").run().assert_stdout_equals("foo"); | ||
rustc().print("file-names").input("crate.rs").run().assert_stdout_equals(bin_name("foo")); | ||
rustc() | ||
.print("file-names") | ||
.crate_type("lib") | ||
.arg("--test") | ||
.input("crate.rs") | ||
.run() | ||
.assert_stdout_equals(bin_name("foo")); | ||
rustc() | ||
.print("file-names") | ||
.arg("--test") | ||
.input("lib.rs") | ||
.run() | ||
.assert_stdout_equals(bin_name("mylib")); | ||
rustc().print("file-names").input("lib.rs").run().assert_stdout_equals(rust_lib_name("mylib")); | ||
rustc().print("file-names").input("rlib.rs").run().assert_stdout_equals(rust_lib_name("mylib")); | ||
} |
Oops, something went wrong.