[cogl] tests: Add a flag to say that the test is known to fail in all cases



commit 58cf84f8efbc7a7aefebef667b42e5a7151ab27d
Author: Neil Roberts <neil linux intel com>
Date:   Tue Mar 6 23:41:49 2012 +0000

    tests: Add a flag to say that the test is known to fail in all cases
    
    This renames the TestRequirement enum to TestFlags and then adds a
    TEST_KNOWN_FAILURE flag. The rename is because the new flag is not
    really a requirement. If the flag is set then the test is assumed to
    always fail.
    
    Reviewed-by: Robert Bragg <robert linux intel com>

 tests/conform/test-utils.c |   13 +++++++++----
 tests/conform/test-utils.h |    9 +++++----
 2 files changed, 14 insertions(+), 8 deletions(-)
---
diff --git a/tests/conform/test-utils.c b/tests/conform/test-utils.c
index 3886772..08423dc 100644
--- a/tests/conform/test-utils.c
+++ b/tests/conform/test-utils.c
@@ -11,7 +11,7 @@ static gboolean cogl_test_is_verbose;
 
 void
 test_utils_init (TestUtilsSharedState *state,
-                 TestRequirement requirements)
+                 TestFlags flags)
 {
   static int counter = 0;
   GError *error = NULL;
@@ -50,24 +50,29 @@ test_utils_init (TestUtilsSharedState *state,
   display = cogl_context_get_display (state->ctx);
   renderer = cogl_display_get_renderer (display);
 
-  if (requirements & TEST_REQUIREMENT_GL &&
+  if (flags & TEST_REQUIREMENT_GL &&
       cogl_renderer_get_driver (renderer) != COGL_DRIVER_GL)
     {
       missing_requirement = TRUE;
     }
 
-  if (requirements & TEST_REQUIREMENT_NPOT &&
+  if (flags & TEST_REQUIREMENT_NPOT &&
       !cogl_has_feature (state->ctx, COGL_FEATURE_ID_TEXTURE_NPOT))
     {
       missing_requirement = TRUE;
     }
 
-  if (requirements & TEST_REQUIREMENT_TEXTURE_3D &&
+  if (flags & TEST_REQUIREMENT_TEXTURE_3D &&
       !cogl_has_feature (state->ctx, COGL_FEATURE_ID_TEXTURE_3D))
     {
       missing_requirement = TRUE;
     }
 
+  if (flags & TEST_KNOWN_FAILURE)
+    {
+      missing_requirement = TRUE;
+    }
+
   if (getenv  ("COGL_TEST_ONSCREEN"))
     {
       onscreen = cogl_onscreen_new (state->ctx, 640, 480);
diff --git a/tests/conform/test-utils.h b/tests/conform/test-utils.h
index b856e9e..3dbf94d 100644
--- a/tests/conform/test-utils.h
+++ b/tests/conform/test-utils.h
@@ -7,12 +7,13 @@
 #pragma GCC diagnostic ignored "-Wmissing-declarations"
 #endif
 
-typedef enum _TestRequirement
+typedef enum _TestFlags
 {
-  TEST_REQUIREMENT_GL         = 1<<0,
+  TEST_KNOWN_FAILURE          = 1<<0,
+  TEST_REQUIREMENT_GL         = 1<<1,
   TEST_REQUIREMENT_NPOT       = 1<<2,
   TEST_REQUIREMENT_TEXTURE_3D = 1<<3
-} TestRequirement;
+} TestFlags;
 
 /* For compatability since we used to use the glib gtester
  * infrastructure and all our unit tests have an entry
@@ -33,7 +34,7 @@ typedef struct _TestUtilsSharedState
 
 void
 test_utils_init (TestUtilsSharedState *state,
-                 TestRequirement requirements);
+                 TestFlags flags);
 
 void
 test_utils_fini (TestUtilsSharedState *state);



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