mirror of
https://github.com/zaphar/ucg.git
synced 2025-07-22 18:19:54 -04:00
BUGFIX: Errors in validation reporting.
This commit is contained in:
parent
bd4c9a26c0
commit
c3048915d4
36
src/main.rs
36
src/main.rs
@ -91,7 +91,14 @@ fn build_file(
|
|||||||
fn do_validate(file: &str, cache: Rc<RefCell<Cache>>) -> bool {
|
fn do_validate(file: &str, cache: Rc<RefCell<Cache>>) -> bool {
|
||||||
println!("Validating {}", file);
|
println!("Validating {}", file);
|
||||||
match build_file(file, true, cache) {
|
match build_file(file, true, cache) {
|
||||||
Ok(_) => println!("{} validates\n\n", file),
|
Ok(b) => {
|
||||||
|
if b.assert_collector.success {
|
||||||
|
println!("File {} Pass\n", file);
|
||||||
|
} else {
|
||||||
|
println!("File {} Fail\n", file);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
Err(msg) => {
|
Err(msg) => {
|
||||||
eprintln!("Err: {}", msg);
|
eprintln!("Err: {}", msg);
|
||||||
return false;
|
return false;
|
||||||
@ -259,28 +266,11 @@ fn main() {
|
|||||||
let mut ok = true;
|
let mut ok = true;
|
||||||
for file in files.unwrap() {
|
for file in files.unwrap() {
|
||||||
let pb = PathBuf::from(file);
|
let pb = PathBuf::from(file);
|
||||||
if pb.is_dir() {
|
//if pb.is_dir() {
|
||||||
if let Ok(false) =
|
if let Ok(false) =
|
||||||
visit_ucg_files(pb.as_path(), recurse, true, cache.clone(), ®istry)
|
visit_ucg_files(pb.as_path(), recurse, true, cache.clone(), ®istry)
|
||||||
{
|
{
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
|
||||||
} else {
|
|
||||||
match build_file(file, true, cache.clone()) {
|
|
||||||
Ok(b) => {
|
|
||||||
if b.assert_collector.success {
|
|
||||||
println!("File {} Validates", file);
|
|
||||||
} else {
|
|
||||||
println!("File {} Fails", file);
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Err(msg) => {
|
|
||||||
// We continue to process the other files despite this failure.
|
|
||||||
eprintln!("{}", msg);
|
|
||||||
ok = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !ok {
|
if !ok {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user