[thin_restore (rust)] Fix errors in tests

- Move error messages to stderr (fixes unwritable_output_file,
  input_file_not_found, and missing_input_option)
- Validate XML structures implicitly (fixes corrupted_input_data)
- Check output file size (fixes tiny_output_file)
- Provide XML error context
- Fix mk_valid_input()
This commit is contained in:
Ming-Hung Tsai
2021-08-31 12:33:12 +08:00
parent aaa84aa35a
commit 0acc57d17f
6 changed files with 75 additions and 18 deletions
+6 -1
View File
@@ -62,6 +62,11 @@ fn main() {
exit(1);
}
if let Err(e) = file_utils::check_output_file_requirements(output_file) {
eprintln!("{}", e);
exit(1);
}
let report;
if matches.is_present("QUIET") {
@@ -80,7 +85,7 @@ fn main() {
};
if let Err(reason) = restore(opts) {
println!("{}", reason);
eprintln!("{}", reason);
process::exit(1);
}
}