mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-18 09:03:18 +00:00
Enable 64bit vs 32bit tests
This commit is contained in:
parent
83ddce4a90
commit
6982d66a59
1 changed files with 13 additions and 1 deletions
|
@ -1,6 +1,9 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate duct;
|
extern crate duct;
|
||||||
|
|
||||||
|
use std::io::{BufRead, BufReader};
|
||||||
|
use std::fs::File;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn examples() {
|
fn examples() {
|
||||||
let mut error = false;
|
let mut error = false;
|
||||||
|
@ -10,6 +13,16 @@ fn examples() {
|
||||||
if file.extension().map_or(true, |file| file != "rs") {
|
if file.extension().map_or(true, |file| file != "rs") {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
print!("testing {}... ", file.file_stem().unwrap().to_str().unwrap());
|
||||||
|
let skip = BufReader::new(File::open(&file).unwrap()).lines().any(|line| {
|
||||||
|
let line = line.as_ref().unwrap().trim();
|
||||||
|
line == "// ignore-x86" && cfg!(target_pointer_width = "32") ||
|
||||||
|
line == "// ignore-x86_64" && cfg!(target_pointer_width = "64")
|
||||||
|
});
|
||||||
|
if skip {
|
||||||
|
println!("skipping");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
cmd!("touch", &file).run().unwrap();
|
cmd!("touch", &file).run().unwrap();
|
||||||
let output = file.with_extension("stderr");
|
let output = file.with_extension("stderr");
|
||||||
cmd!("cargo", "rustc", "-q", "--example", file.file_stem().unwrap(), "--", "-Dwarnings",
|
cmd!("cargo", "rustc", "-q", "--example", file.file_stem().unwrap(), "--", "-Dwarnings",
|
||||||
|
@ -22,7 +35,6 @@ fn examples() {
|
||||||
.dir("clippy_tests")
|
.dir("clippy_tests")
|
||||||
.run()
|
.run()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
print!("testing {}... ", file.file_stem().unwrap().to_str().unwrap());
|
|
||||||
if cmd!("git", "diff", "--exit-code", output).run().is_err() {
|
if cmd!("git", "diff", "--exit-code", output).run().is_err() {
|
||||||
error = true;
|
error = true;
|
||||||
println!("ERROR");
|
println!("ERROR");
|
||||||
|
|
Loading…
Reference in a new issue