[lasem] lsm-test: display OK when output is similar to the reference file.



commit 624ca30454aa5674c790896e50e1f5d1b30b1ecf
Author: Emmanuel Pacaud <emmanuel gnome org>
Date:   Thu Oct 18 10:28:51 2012 +0200

    lsm-test: display OK when output is similar to the reference file.

 tests/lsmtest.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/tests/lsmtest.c b/tests/lsmtest.c
index e3a1c44..83f0be3 100644
--- a/tests/lsmtest.c
+++ b/tests/lsmtest.c
@@ -74,7 +74,9 @@ static const GOptionEntry entries[] =
 	{ NULL }
 };
 
-static const char *fail_face = "", *normal_face = "";
+static const char *fail_face = "";
+static const char *success_face = "";
+static const char *normal_face = "";
 FILE *lasem_test_html_file = NULL;
 
 static void
@@ -197,12 +199,12 @@ compare_surfaces (const char *test_name, cairo_surface_t *surface_a, cairo_surfa
 		g_free (diff_png_filename);
 
 		if (result.pixels_changed == 0) {
-			g_printf ("\n");
+			g_printf (" %sOK%s \n", success_face, normal_face);
 			return TRUE;
 		}
 	}
 
-	g_printf (" %sFAIL%s\n", fail_face, normal_face);
+	g_printf (" %sFAIL%s \n", fail_face, normal_face);
 	return FALSE;
 }
 
@@ -449,6 +451,7 @@ main (int argc, char **argv)
 #ifdef HAVE_UNISTD_H
 	if (isatty (2)) {
 		fail_face = "\033[41m\033[37m\033[1m";
+		success_face = "\033[42m\033[37m\033[1m";
 		normal_face = "\033[m";
 	}
 #endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]