[librsvg: 24/53] Output the path to output and difference images created during tests
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 24/53] Output the path to output and difference images created during tests
- Date: Fri, 23 Oct 2020 02:19:07 +0000 (UTC)
commit 164218b087cb7dfbd52820b3854adce4ff651d4b
Author: Sven Neumann <sven svenfoo org>
Date: Thu Oct 15 15:15:32 2020 +0200
Output the path to output and difference images created during tests
librsvg_crate/tests/standalone/utils.rs | 6 ++++--
tests/src/reference.rs | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/librsvg_crate/tests/standalone/utils.rs b/librsvg_crate/tests/standalone/utils.rs
index 02adc48a..0ba9ef63 100644
--- a/librsvg_crate/tests/standalone/utils.rs
+++ b/librsvg_crate/tests/standalone/utils.rs
@@ -53,8 +53,6 @@ pub fn output_dir() -> PathBuf {
fs::create_dir_all(&path).expect("could not create output directory for tests");
- println!("outputting to {}", path.to_string_lossy());
-
path
}
@@ -94,6 +92,8 @@ pub fn compare_to_surface(
) {
let output_path = output_dir().join(&format!("{}-out.png", output_base_name));
+ println!("output:\t{}", output_path.to_string_lossy());
+
let mut output_file = File::create(output_path).unwrap();
output_surf
.clone()
@@ -115,6 +115,8 @@ fn evaluate_diff(diff: &BufferDiff, output_base_name: &str) {
BufferDiff::Diff(diff) => {
let surf = diff.surface.clone().into_image_surface().unwrap();
let diff_path = output_dir().join(&format!("{}-diff.png", output_base_name));
+ println!("diff:\t{}", diff_path.to_string_lossy());
+
let mut output_file = File::create(diff_path).unwrap();
surf.write_to_png(&mut output_file).unwrap();
diff --git a/tests/src/reference.rs b/tests/src/reference.rs
index 13b3c78e..02d62bc3 100644
--- a/tests/src/reference.rs
+++ b/tests/src/reference.rs
@@ -209,8 +209,6 @@ mod duplicated_from_librsvg_crate {
fs::create_dir_all(&path).expect("could not create output directory for tests");
- println!("outputting to {}", path.to_string_lossy());
-
path
}
@@ -236,6 +234,7 @@ mod duplicated_from_librsvg_crate {
output_base_name: &str,
) {
let output_path = output_dir().join(&format!("{}-out.png", output_base_name));
+ println!("output:\t{}", output_path.to_string_lossy());
let mut output_file = File::create(output_path).unwrap();
output_surf
@@ -258,6 +257,8 @@ mod duplicated_from_librsvg_crate {
BufferDiff::Diff(diff) => {
let surf = diff.surface.clone().into_image_surface().unwrap();
let diff_path = output_dir().join(&format!("{}-diff.png", output_base_name));
+ println!("diff:\t{}", diff_path.to_string_lossy());
+
let mut output_file = File::create(diff_path).unwrap();
surf.write_to_png(&mut output_file).unwrap();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]