2019-06-25 04:43:38 +00:00
|
|
|
#[test]
|
2019-07-26 21:33:02 +00:00
|
|
|
#[ignore]
|
2019-06-25 04:43:38 +00:00
|
|
|
fn fmt() {
|
|
|
|
if option_env!("RUSTC_TEST_SUITE").is_some() {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
let root_dir = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
|
|
|
let dev_dir = root_dir.join("clippy_dev");
|
|
|
|
let output = std::process::Command::new("cargo")
|
|
|
|
.current_dir(dev_dir)
|
2019-07-05 05:49:19 +00:00
|
|
|
.args(&["+nightly", "run", "--", "fmt", "--check"])
|
2019-06-25 04:43:38 +00:00
|
|
|
.output()
|
|
|
|
.unwrap();
|
|
|
|
|
|
|
|
println!("status: {}", output.status);
|
|
|
|
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
|
|
|
|
println!("stderr: {}", String::from_utf8_lossy(&output.stderr));
|
|
|
|
|
2019-06-26 04:08:33 +00:00
|
|
|
assert!(
|
|
|
|
output.status.success(),
|
|
|
|
"Formatting check failed. Run `./util/dev fmt` to update formatting."
|
|
|
|
);
|
2019-06-25 04:43:38 +00:00
|
|
|
}
|