Fixes #13: Enable conditional compilation of ISAs through features;

This commit is contained in:
Benjamin Bouvier
2019-02-11 15:01:10 +01:00
committed by Dan Gohman
parent 049f067168
commit a45b814de8
12 changed files with 129 additions and 90 deletions

View File

@@ -33,7 +33,21 @@ pub fn run(path: &Path, passes: Option<&[String]>, target: Option<&str>) -> Test
info!("---\nFile: {}", path.to_string_lossy());
let started = time::Instant::now();
let buffer = read_to_string(path).map_err(|e| e.to_string())?;
let testfile = parse_test(&buffer, passes, target).map_err(|e| e.to_string())?;
let testfile = match parse_test(&buffer, passes, target) {
Ok(testfile) => testfile,
Err(e) => {
if e.is_warning {
println!(
"skipping test {:?} (line {}): {}",
path, e.location.line_number, e.message
);
return Ok(started.elapsed());
}
return Err(e.to_string());
}
};
if testfile.functions.is_empty() {
return Err("no functions found".to_string());
}