Skip to content

Commit

Permalink
Fix file_source_test
Browse files Browse the repository at this point in the history
  • Loading branch information
kriw authored and XVilka committed Aug 6, 2018
1 parent 27e1898 commit 4d71902
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions src/frontend/radeco_source.rs
Expand Up @@ -486,24 +486,9 @@ mod test {

#[test]
fn file_source_test() {
let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let paths = ["ex-bins/bin1",
"ex-bins/simple", "ex-bins/simple2"];
for p in paths.iter() {
let mut path = root_dir.clone();
path.push(p);
let base_name = path.file_name()
.unwrap().to_str().unwrap();
write_source_test(path.to_str().unwrap());
FileSource::open(base_name);
}
}

fn write_source_test(proj_path: &str) {
let mut r2 = R2::new(Some(proj_path))
.expect("Unable to open r2");
r2.analyze_all();
let r2w = Rc::new(RefCell::new(r2));
FileSource::from(r2w);
let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
path.push("test_files/bin1_filesource/bin1");
let source = FileSource::open(path.to_str().unwrap());
ProjectLoader::new().source(Rc::new(source)).load();
}
}

0 comments on commit 4d71902

Please sign in to comment.