[gtk+/parser: 79/79] xxx: rework test runner



commit 91d1d29d91ec35a4d9a5bfa0b70141e769a320fe
Author: Benjamin Otte <otte redhat com>
Date:   Fri Apr 15 03:21:29 2011 +0200

    xxx: rework test runner

 tests/css/parser/test-css-parser.c |   17 ++++-------------
 1 files changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/tests/css/parser/test-css-parser.c b/tests/css/parser/test-css-parser.c
index 38c7553..ed1e3e0 100644
--- a/tests/css/parser/test-css-parser.c
+++ b/tests/css/parser/test-css-parser.c
@@ -26,8 +26,6 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 
-static guint failures = 0;
-
 static char *
 test_get_reference_file (const char *css_file)
 {
@@ -172,7 +170,6 @@ test_css_file (GFile *file)
   char *css_file, *reference_file, *errors_file;
   GString *errors;
   GError *error = NULL;
-  gboolean success = TRUE;
 
   css_file = g_file_get_path (file);
   errors = g_string_new ("");
@@ -196,7 +193,7 @@ test_css_file (GFile *file)
   if (diff && diff[0])
     {
       g_test_message ("%s", diff);
-      success = FALSE;
+      g_test_fail ();
     }
 
   g_free (css);
@@ -212,13 +209,13 @@ test_css_file (GFile *file)
       if (diff && diff[0])
         {
           g_test_message ("%s", diff);
-          success = FALSE;
+          g_test_fail ();
         }
     }
   else if (errors->str[0])
     {
       g_test_message ("Unexpected errors:\n%s", errors->str);
-      success = FALSE;
+      g_test_fail ();
     }
 
   g_free (errors_file);
@@ -226,12 +223,6 @@ test_css_file (GFile *file)
 
   g_free (diff);
   g_free (css_file);
-  
-  if (!success)
-    {
-      failures++;
-      g_print ("NOT ");
-    }
 }
 
 static void
@@ -429,6 +420,6 @@ main (int argc, char **argv)
         }
     }
 
-  return g_test_run () + failures;
+  return g_test_run ();
 }
 



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