tests: Don't report success when the test is skipped

The tests that were using GLSL or 3D textures were directly printing
“Skipped” and then reporting success. Instead of doing this they now
just try to continue without checking for the feature but the
appropriate test requirement flag is now set in test-conform-main so
the table of results will correctly display that is a failure.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit b8f918e44b243a5fa36d5f382a90bebb0de0728f)
This commit is contained in:
Neil Roberts 2012-11-09 15:14:33 +00:00 committed by Robert Bragg
parent fa62fe2a4f
commit 0b8780f94c
8 changed files with 86 additions and 112 deletions

View File

@ -69,7 +69,7 @@ main (int argc, char **argv)
ADD_TEST (test_sub_texture, 0);
ADD_TEST (test_pixel_buffer, 0);
UNPORTED_TEST (test_texture_rectangle);
ADD_TEST (test_texture_3d, 0);
ADD_TEST (test_texture_3d, TEST_REQUIREMENT_TEXTURE_3D);
ADD_TEST (test_wrap_modes, 0);
UNPORTED_TEST (test_texture_pixmap_x11);
UNPORTED_TEST (test_texture_get_set_data);
@ -83,10 +83,10 @@ main (int argc, char **argv)
ADD_TEST (test_primitive, 0);
ADD_TEST (test_just_vertex_shader, 0);
ADD_TEST (test_pipeline_uniforms, 0);
ADD_TEST (test_snippets, 0);
ADD_TEST (test_custom_attributes, 0);
ADD_TEST (test_just_vertex_shader, TEST_REQUIREMENT_GLSL);
ADD_TEST (test_pipeline_uniforms, TEST_REQUIREMENT_GLSL);
ADD_TEST (test_snippets, TEST_REQUIREMENT_GLSL);
ADD_TEST (test_custom_attributes, TEST_REQUIREMENT_GLSL);
ADD_TEST (test_bitmask, 0);

View File

@ -269,9 +269,6 @@ paint (TestState *state)
void
test_custom_attributes (void)
{
/* If shaders aren't supported then we can't run the test */
if (cogl_features_available (COGL_FEATURE_SHADERS_GLSL))
{
CoglSnippet *snippet;
TestState state;
@ -297,6 +294,3 @@ test_custom_attributes (void)
if (cogl_test_verbose ())
g_print ("OK\n");
}
else if (cogl_test_verbose ())
g_print ("Skipping\n");
}

View File

@ -186,9 +186,6 @@ test_just_vertex_shader (void)
-1,
100);
/* If shaders aren't supported then we can't run the test */
if (cogl_features_available (COGL_FEATURE_SHADERS_GLSL))
{
/* XXX: we have to push/pop a framebuffer since this test currently
* uses the legacy cogl_rectangle() api. */
cogl_push_framebuffer (test_fb);
@ -204,7 +201,3 @@ test_just_vertex_shader (void)
if (cogl_test_verbose ())
g_print ("OK\n");
}
else if (cogl_test_verbose ())
g_print ("Skipping\n");
}

View File

@ -382,9 +382,6 @@ validate_long_pipeline_result (void)
void
test_pipeline_uniforms (void)
{
/* If shaders aren't supported then we can't run the test */
if (cogl_features_available (COGL_FEATURE_SHADERS_GLSL))
{
TestState state;
@ -416,6 +413,3 @@ test_pipeline_uniforms (void)
if (cogl_test_verbose ())
g_print ("OK\n");
}
else if (cogl_test_verbose ())
g_print ("Skipping\n");
}

View File

@ -690,9 +690,6 @@ run_tests (TestState *state)
void
test_snippets (void)
{
/* If shaders aren't supported then we can't run the test */
if (cogl_features_available (COGL_FEATURE_SHADERS_GLSL))
{
TestState state;
@ -708,6 +705,3 @@ test_snippets (void)
if (cogl_test_verbose ())
g_print ("OK\n");
}
else if (cogl_test_verbose ())
g_print ("Skipping\n");
}

View File

@ -255,10 +255,6 @@ test_multi_texture (TestState *state)
void
test_texture_3d (void)
{
/* Check whether GL supports the rectangle extension. If not we'll
just assume the test passes */
if (cogl_has_feature (test_ctx, COGL_FEATURE_ID_TEXTURE_3D))
{
TestState state;
@ -279,7 +275,3 @@ test_texture_3d (void)
if (cogl_test_verbose ())
g_print ("OK\n");
}
else if (cogl_test_verbose ())
g_print ("Skipping\n");
}

View File

@ -89,6 +89,12 @@ test_utils_init (TestFlags flags)
missing_requirement = TRUE;
}
if (flags & TEST_REQUIREMENT_GLSL &&
!cogl_has_feature (test_ctx, COGL_FEATURE_ID_GLSL))
{
missing_requirement = TRUE;
}
if (flags & TEST_KNOWN_FAILURE)
{
missing_requirement = TRUE;

View File

@ -17,7 +17,8 @@ typedef enum _TestFlags
TEST_REQUIREMENT_TEXTURE_3D = 1<<3,
TEST_REQUIREMENT_POINT_SPRITE = 1<<4,
TEST_REQUIREMENT_GLES2_CONTEXT = 1<<5,
TEST_REQUIREMENT_MAP_WRITE = 1<<6
TEST_REQUIREMENT_MAP_WRITE = 1<<6,
TEST_REQUIREMENT_GLSL = 1<<7
} TestFlags;
extern CoglContext *test_ctx;