2011-05-05 18:34:38 -04:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <cogl/cogl.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <locale.h>
|
|
|
|
#include <stdlib.h>
|
2012-02-23 07:30:51 -05:00
|
|
|
#include <string.h>
|
2011-05-05 18:34:38 -04:00
|
|
|
|
|
|
|
#include "test-utils.h"
|
|
|
|
|
2012-02-23 07:30:51 -05:00
|
|
|
static TestUtilsSharedState *shared_state = NULL;
|
2011-05-05 18:34:38 -04:00
|
|
|
|
2012-02-23 07:30:51 -05:00
|
|
|
/* A bit of sugar for adding new conformance tests */
|
|
|
|
#define ADD_TEST(FUNC, REQUIREMENTS) G_STMT_START { \
|
|
|
|
extern void FUNC (TestUtilsGTestFixture *, void *); \
|
|
|
|
if (strcmp (#FUNC, argv[1]) == 0) \
|
|
|
|
{ \
|
|
|
|
test_utils_init (shared_state, REQUIREMENTS); \
|
|
|
|
FUNC (NULL, shared_state); \
|
|
|
|
test_utils_fini (shared_state); \
|
|
|
|
exit (0); \
|
|
|
|
} \
|
|
|
|
} G_STMT_END
|
2011-05-05 18:34:38 -04:00
|
|
|
|
2012-02-23 07:30:51 -05:00
|
|
|
#define UNPORTED_TEST(FUNC)
|
2011-05-05 18:34:38 -04:00
|
|
|
|
2012-02-23 07:30:51 -05:00
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
2011-05-05 18:34:38 -04:00
|
|
|
{
|
2012-02-23 07:30:51 -05:00
|
|
|
int i;
|
2011-05-05 18:34:38 -04:00
|
|
|
|
2012-02-23 07:30:51 -05:00
|
|
|
if (argc != 2)
|
2011-05-05 18:34:38 -04:00
|
|
|
{
|
2012-02-23 07:30:51 -05:00
|
|
|
g_printerr ("usage %s UNIT_TEST\n", argv[0]);
|
|
|
|
exit (1);
|
2011-05-05 18:34:38 -04:00
|
|
|
}
|
|
|
|
|
2012-02-23 07:30:51 -05:00
|
|
|
/* Just for convenience in case people try passing the wrapper
|
|
|
|
* filenames for the UNIT_TEST argument we normalize '-' characters
|
|
|
|
* to '_' characters... */
|
|
|
|
for (i = 0; argv[1][i]; i++)
|
|
|
|
{
|
|
|
|
if (argv[1][i] == '-')
|
|
|
|
argv[1][i] = '_';
|
|
|
|
}
|
2011-05-05 18:34:38 -04:00
|
|
|
|
|
|
|
/* Initialise the state you need to share with everything.
|
|
|
|
*/
|
|
|
|
shared_state = g_new0 (TestUtilsSharedState, 1);
|
|
|
|
shared_state->argc_addr = &argc;
|
|
|
|
shared_state->argv_addr = &argv;
|
|
|
|
|
|
|
|
/* This file is run through a sed script during the make step so the
|
|
|
|
* lines containing the tests need to be formatted on a single line
|
2012-02-23 07:30:51 -05:00
|
|
|
* each.
|
|
|
|
*/
|
|
|
|
|
|
|
|
UNPORTED_TEST (test_cogl_object);
|
|
|
|
UNPORTED_TEST (test_cogl_fixed);
|
|
|
|
UNPORTED_TEST (test_cogl_materials);
|
|
|
|
ADD_TEST (test_cogl_pipeline_user_matrix, 0);
|
|
|
|
ADD_TEST (test_cogl_blend_strings, 0);
|
|
|
|
UNPORTED_TEST (test_cogl_premult);
|
|
|
|
UNPORTED_TEST (test_cogl_readpixels);
|
|
|
|
ADD_TEST (test_cogl_path, 0);
|
|
|
|
ADD_TEST (test_cogl_depth_test, 0);
|
|
|
|
ADD_TEST (test_cogl_color_mask, 0);
|
|
|
|
ADD_TEST (test_cogl_backface_culling, TEST_REQUIREMENT_NPOT);
|
|
|
|
|
|
|
|
ADD_TEST (test_cogl_sparse_pipeline, 0);
|
|
|
|
|
|
|
|
UNPORTED_TEST (test_cogl_npot_texture);
|
|
|
|
UNPORTED_TEST (test_cogl_multitexture);
|
|
|
|
UNPORTED_TEST (test_cogl_texture_mipmaps);
|
2012-03-05 16:49:28 -05:00
|
|
|
ADD_TEST (test_cogl_sub_texture, 0);
|
2012-02-25 16:00:55 -05:00
|
|
|
ADD_TEST (test_cogl_pixel_buffer, 0);
|
2012-02-23 07:30:51 -05:00
|
|
|
UNPORTED_TEST (test_cogl_texture_rectangle);
|
|
|
|
ADD_TEST (test_cogl_texture_3d, 0);
|
|
|
|
ADD_TEST (test_cogl_wrap_modes, 0);
|
|
|
|
UNPORTED_TEST (test_cogl_texture_pixmap_x11);
|
|
|
|
UNPORTED_TEST (test_cogl_texture_get_set_data);
|
|
|
|
UNPORTED_TEST (test_cogl_atlas_migration);
|
2012-02-29 16:43:01 -05:00
|
|
|
ADD_TEST (test_cogl_read_texture_formats, 0);
|
2012-02-29 19:40:34 -05:00
|
|
|
ADD_TEST (test_cogl_write_texture_formats, 0);
|
2012-02-23 07:30:51 -05:00
|
|
|
|
|
|
|
UNPORTED_TEST (test_cogl_vertex_buffer_contiguous);
|
|
|
|
UNPORTED_TEST (test_cogl_vertex_buffer_interleved);
|
|
|
|
UNPORTED_TEST (test_cogl_vertex_buffer_mutability);
|
|
|
|
|
|
|
|
ADD_TEST (test_cogl_primitive, 0);
|
|
|
|
|
|
|
|
ADD_TEST (test_cogl_just_vertex_shader, 0);
|
|
|
|
ADD_TEST (test_cogl_pipeline_uniforms, 0);
|
|
|
|
ADD_TEST (test_cogl_snippets, 0);
|
|
|
|
ADD_TEST (test_cogl_custom_attributes, 0);
|
|
|
|
|
|
|
|
ADD_TEST (test_cogl_bitmask, 0);
|
|
|
|
|
|
|
|
ADD_TEST (test_cogl_offscreen, 0);
|
|
|
|
|
2012-03-06 18:14:27 -05:00
|
|
|
ADD_TEST (test_cogl_point_size, 0);
|
2012-03-06 18:36:45 -05:00
|
|
|
ADD_TEST (test_cogl_point_sprite,
|
|
|
|
TEST_KNOWN_FAILURE | TEST_REQUIREMENT_POINT_SPRITE);
|
2012-03-06 18:14:27 -05:00
|
|
|
|
2012-02-23 07:30:51 -05:00
|
|
|
UNPORTED_TEST (test_cogl_viewport);
|
|
|
|
|
|
|
|
g_printerr ("Unknown test name \"%s\"\n", argv[1]);
|
|
|
|
|
|
|
|
return 1;
|
2011-05-05 18:34:38 -04:00
|
|
|
}
|