2011-05-05 22:34:38 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
|
|
|
#include <cogl/cogl.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <locale.h>
|
|
|
|
#include <stdlib.h>
|
2012-02-23 12:30:51 +00:00
|
|
|
#include <string.h>
|
2011-05-05 22:34:38 +00:00
|
|
|
|
|
|
|
#include "test-utils.h"
|
|
|
|
|
2012-02-23 12:30:51 +00:00
|
|
|
/* A bit of sugar for adding new conformance tests */
|
|
|
|
#define ADD_TEST(FUNC, REQUIREMENTS) G_STMT_START { \
|
2012-03-16 19:54:13 +00:00
|
|
|
extern void FUNC (void); \
|
2012-02-23 12:30:51 +00:00
|
|
|
if (strcmp (#FUNC, argv[1]) == 0) \
|
|
|
|
{ \
|
2012-03-16 19:54:13 +00:00
|
|
|
test_utils_init (REQUIREMENTS); \
|
|
|
|
FUNC (); \
|
|
|
|
test_utils_fini (); \
|
2012-02-23 12:30:51 +00:00
|
|
|
exit (0); \
|
|
|
|
} \
|
|
|
|
} G_STMT_END
|
2011-05-05 22:34:38 +00:00
|
|
|
|
2012-02-23 12:30:51 +00:00
|
|
|
#define UNPORTED_TEST(FUNC)
|
2011-05-05 22:34:38 +00:00
|
|
|
|
2012-02-23 12:30:51 +00:00
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
2011-05-05 22:34:38 +00:00
|
|
|
{
|
2012-02-23 12:30:51 +00:00
|
|
|
int i;
|
2011-05-05 22:34:38 +00:00
|
|
|
|
2012-02-23 12:30:51 +00:00
|
|
|
if (argc != 2)
|
2011-05-05 22:34:38 +00:00
|
|
|
{
|
2012-02-23 12:30:51 +00:00
|
|
|
g_printerr ("usage %s UNIT_TEST\n", argv[0]);
|
|
|
|
exit (1);
|
2011-05-05 22:34:38 +00:00
|
|
|
}
|
|
|
|
|
2012-02-23 12:30:51 +00: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 22:34:38 +00:00
|
|
|
|
|
|
|
/* 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 12:30:51 +00:00
|
|
|
* each.
|
|
|
|
*/
|
|
|
|
|
2012-03-16 19:54:13 +00:00
|
|
|
UNPORTED_TEST (test_object);
|
|
|
|
UNPORTED_TEST (test_fixed);
|
|
|
|
UNPORTED_TEST (test_materials);
|
|
|
|
ADD_TEST (test_pipeline_user_matrix, 0);
|
|
|
|
ADD_TEST (test_blend_strings, 0);
|
2012-04-02 22:41:54 +00:00
|
|
|
ADD_TEST (test_premult, 0);
|
2012-03-16 19:54:13 +00:00
|
|
|
UNPORTED_TEST (test_readpixels);
|
|
|
|
ADD_TEST (test_path, 0);
|
|
|
|
ADD_TEST (test_depth_test, 0);
|
|
|
|
ADD_TEST (test_color_mask, 0);
|
|
|
|
ADD_TEST (test_backface_culling, TEST_REQUIREMENT_NPOT);
|
2012-05-24 11:54:44 +00:00
|
|
|
ADD_TEST (test_layer_remove, 0);
|
2012-03-16 19:54:13 +00:00
|
|
|
|
|
|
|
ADD_TEST (test_sparse_pipeline, 0);
|
|
|
|
|
|
|
|
UNPORTED_TEST (test_npot_texture);
|
|
|
|
UNPORTED_TEST (test_multitexture);
|
|
|
|
UNPORTED_TEST (test_texture_mipmaps);
|
|
|
|
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_wrap_modes, 0);
|
|
|
|
UNPORTED_TEST (test_texture_pixmap_x11);
|
|
|
|
UNPORTED_TEST (test_texture_get_set_data);
|
2012-05-16 11:57:32 +00:00
|
|
|
ADD_TEST (test_atlas_migration, 0);
|
2012-03-16 19:54:13 +00:00
|
|
|
ADD_TEST (test_read_texture_formats, 0);
|
|
|
|
ADD_TEST (test_write_texture_formats, 0);
|
|
|
|
|
|
|
|
UNPORTED_TEST (test_vertex_buffer_contiguous);
|
|
|
|
UNPORTED_TEST (test_vertex_buffer_interleved);
|
|
|
|
UNPORTED_TEST (test_vertex_buffer_mutability);
|
|
|
|
|
|
|
|
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_bitmask, 0);
|
|
|
|
|
|
|
|
ADD_TEST (test_offscreen, 0);
|
|
|
|
|
|
|
|
ADD_TEST (test_point_size, 0);
|
|
|
|
ADD_TEST (test_point_sprite,
|
2012-07-02 13:50:54 +00:00
|
|
|
TEST_REQUIREMENT_POINT_SPRITE);
|
|
|
|
ADD_TEST (test_point_sprite_orientation,
|
2012-03-06 23:36:45 +00:00
|
|
|
TEST_KNOWN_FAILURE | TEST_REQUIREMENT_POINT_SPRITE);
|
2012-03-06 23:14:27 +00:00
|
|
|
|
2012-04-23 13:09:19 +00:00
|
|
|
ADD_TEST (test_version, 0);
|
|
|
|
|
2012-03-16 19:54:13 +00:00
|
|
|
UNPORTED_TEST (test_viewport);
|
2012-02-23 12:30:51 +00:00
|
|
|
|
2012-04-26 11:18:56 +00:00
|
|
|
ADD_TEST (test_gles2_context, TEST_REQUIREMENT_GLES2_CONTEXT);
|
2012-08-07 14:12:37 +00:00
|
|
|
ADD_TEST (test_gles2_context_fbo, TEST_REQUIREMENT_GLES2_CONTEXT);
|
2012-08-09 15:03:35 +00:00
|
|
|
ADD_TEST (test_gles2_context_copy_tex_image, TEST_REQUIREMENT_GLES2_CONTEXT);
|
2012-04-19 17:48:19 +00:00
|
|
|
|
2012-05-17 21:30:37 +00:00
|
|
|
ADD_TEST (test_euler_quaternion, 0);
|
|
|
|
|
2012-02-23 12:30:51 +00:00
|
|
|
g_printerr ("Unknown test name \"%s\"\n", argv[1]);
|
|
|
|
|
|
|
|
return 1;
|
2011-05-05 22:34:38 +00:00
|
|
|
}
|