From 23928990b9c436682e38c3c27197c432019214ba Mon Sep 17 00:00:00 2001 From: Cameron Zwarich Date: Tue, 6 May 2014 18:13:35 -0400 Subject: [PATCH] servo: Merge #2349 - Print the location of the image diff when a ref test fails (from zwarich:reftest-print-diff); r=larsbergstrom Having to match the numbered results in /tmp with the failing tests was bothering me, and I figured it would be better to print the path with the failure. Source-Repo: https://github.com/servo/servo Source-Revision: 0bb838a58b80dfbf63d09342e15d0af45277d073 --- servo/src/test/harness/reftest/reftest.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/servo/src/test/harness/reftest/reftest.rs b/servo/src/test/harness/reftest/reftest.rs index a6b0ed622984..22d7a90faee9 100644 --- a/servo/src/test/harness/reftest/reftest.rs +++ b/servo/src/test/harness/reftest/reftest.rs @@ -162,7 +162,8 @@ fn check_reftest(reftest: Reftest) { }).collect(); if pixels.iter().any(|&a| a < 255) { - let output = from_str::(format!("/tmp/servo-reftest-{:06u}-diff.png", reftest.id)).unwrap(); + let output_str = format!("/tmp/servo-reftest-{:06u}-diff.png", reftest.id); + let output = from_str::(output_str).unwrap(); let img = png::Image { width: left.width, @@ -173,7 +174,7 @@ fn check_reftest(reftest: Reftest) { let res = png::store_png(&img, &output); assert!(res.is_ok()); - assert!(reftest.kind == Different); + assert!(reftest.kind == Different, "rendering difference: {}", output_str); } else { assert!(reftest.kind == Same); }