2016-05-05 10:21:51 -04:00
|
|
|
#include "cogl-config.h"
|
2011-05-05 18:34:38 -04:00
|
|
|
|
|
|
|
#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
|
|
|
|
2019-01-20 05:41:48 -05:00
|
|
|
#include "test-declarations.h"
|
2011-05-05 18:34:38 -04:00
|
|
|
#include "test-utils.h"
|
|
|
|
|
2012-02-23 07:30:51 -05:00
|
|
|
/* A bit of sugar for adding new conformance tests */
|
2012-11-09 11:47:01 -05:00
|
|
|
#define ADD_TEST(FUNC, REQUIREMENTS, KNOWN_FAIL_REQUIREMENTS) \
|
|
|
|
G_STMT_START { \
|
|
|
|
if (strcmp (#FUNC, argv[1]) == 0) \
|
|
|
|
{ \
|
|
|
|
test_utils_init (REQUIREMENTS, KNOWN_FAIL_REQUIREMENTS); \
|
|
|
|
FUNC (); \
|
|
|
|
test_utils_fini (); \
|
|
|
|
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
|
|
|
|
|
|
|
/* 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.
|
|
|
|
*/
|
|
|
|
|
2012-03-16 15:54:13 -04:00
|
|
|
UNPORTED_TEST (test_object);
|
|
|
|
UNPORTED_TEST (test_fixed);
|
|
|
|
UNPORTED_TEST (test_materials);
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_pipeline_user_matrix, 0, 0);
|
|
|
|
ADD_TEST (test_blend_strings, 0, 0);
|
2013-05-22 14:49:05 -04:00
|
|
|
ADD_TEST (test_blend, 0, 0);
|
2015-07-23 07:59:55 -04:00
|
|
|
ADD_TEST (test_premult, 0, TEST_KNOWN_FAILURE);
|
2012-03-16 15:54:13 -04:00
|
|
|
UNPORTED_TEST (test_readpixels);
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_depth_test, 0, 0);
|
2013-01-21 10:41:16 -05:00
|
|
|
ADD_TEST (test_backface_culling, 0, TEST_REQUIREMENT_NPOT);
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_layer_remove, 0, 0);
|
2012-03-16 15:54:13 -04:00
|
|
|
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_sparse_pipeline, 0, 0);
|
2012-03-16 15:54:13 -04:00
|
|
|
|
2012-12-10 10:47:45 -05:00
|
|
|
ADD_TEST (test_npot_texture, 0, 0);
|
2012-03-16 15:54:13 -04:00
|
|
|
UNPORTED_TEST (test_multitexture);
|
|
|
|
UNPORTED_TEST (test_texture_mipmaps);
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_sub_texture, 0, 0);
|
2012-11-27 15:07:47 -05:00
|
|
|
ADD_TEST (test_pixel_buffer_map, 0, 0);
|
|
|
|
ADD_TEST (test_pixel_buffer_set_data, 0, 0);
|
2012-11-27 15:01:05 -05:00
|
|
|
ADD_TEST (test_pixel_buffer_sub_region, 0, 0);
|
2012-03-16 15:54:13 -04:00
|
|
|
UNPORTED_TEST (test_texture_rectangle);
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_wrap_modes, 0, 0);
|
2012-03-16 15:54:13 -04:00
|
|
|
UNPORTED_TEST (test_texture_pixmap_x11);
|
2012-12-10 10:47:45 -05:00
|
|
|
ADD_TEST (test_texture_get_set_data, 0, 0);
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_atlas_migration, 0, 0);
|
2015-07-23 07:59:55 -04:00
|
|
|
ADD_TEST (test_read_texture_formats, 0, TEST_KNOWN_FAILURE);
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_write_texture_formats, 0, 0);
|
2012-11-19 12:28:53 -05:00
|
|
|
ADD_TEST (test_alpha_textures, 0, 0);
|
2012-03-16 15:54:13 -04:00
|
|
|
|
|
|
|
UNPORTED_TEST (test_vertex_buffer_contiguous);
|
|
|
|
UNPORTED_TEST (test_vertex_buffer_interleved);
|
|
|
|
UNPORTED_TEST (test_vertex_buffer_mutability);
|
|
|
|
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_primitive, 0, 0);
|
2012-03-16 15:54:13 -04:00
|
|
|
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_just_vertex_shader, TEST_REQUIREMENT_GLSL, 0);
|
|
|
|
ADD_TEST (test_pipeline_uniforms, TEST_REQUIREMENT_GLSL, 0);
|
|
|
|
ADD_TEST (test_snippets, TEST_REQUIREMENT_GLSL, 0);
|
|
|
|
ADD_TEST (test_custom_attributes, TEST_REQUIREMENT_GLSL, 0);
|
2012-03-16 15:54:13 -04:00
|
|
|
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_offscreen, 0, 0);
|
2013-01-21 13:39:55 -05:00
|
|
|
ADD_TEST (test_framebuffer_get_bits,
|
|
|
|
TEST_REQUIREMENT_OFFSCREEN | TEST_REQUIREMENT_GL,
|
|
|
|
0);
|
2012-03-16 15:54:13 -04:00
|
|
|
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_point_size, 0, 0);
|
2012-11-08 11:56:02 -05:00
|
|
|
ADD_TEST (test_point_size_attribute,
|
|
|
|
TEST_REQUIREMENT_PER_VERTEX_POINT_SIZE, 0);
|
|
|
|
ADD_TEST (test_point_size_attribute_snippet,
|
|
|
|
TEST_REQUIREMENT_PER_VERTEX_POINT_SIZE |
|
|
|
|
TEST_REQUIREMENT_GLSL, 0);
|
2012-03-16 15:54:13 -04:00
|
|
|
ADD_TEST (test_point_sprite,
|
2012-11-09 11:47:01 -05:00
|
|
|
TEST_REQUIREMENT_POINT_SPRITE,
|
|
|
|
0);
|
2012-07-02 09:50:54 -04:00
|
|
|
ADD_TEST (test_point_sprite_orientation,
|
2012-11-09 11:47:01 -05:00
|
|
|
TEST_REQUIREMENT_POINT_SPRITE,
|
|
|
|
TEST_KNOWN_FAILURE);
|
2013-08-29 09:14:35 -04:00
|
|
|
ADD_TEST (test_point_sprite_glsl,
|
|
|
|
TEST_REQUIREMENT_POINT_SPRITE |
|
|
|
|
TEST_REQUIREMENT_GLSL,
|
|
|
|
0);
|
2012-03-06 18:14:27 -05:00
|
|
|
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_alpha_test, 0, 0);
|
2012-10-01 09:46:24 -04:00
|
|
|
|
2012-11-09 11:47:01 -05:00
|
|
|
ADD_TEST (test_map_buffer_range, TEST_REQUIREMENT_MAP_WRITE, 0);
|
2012-10-17 16:40:26 -04:00
|
|
|
|
2013-02-18 13:21:39 -05:00
|
|
|
ADD_TEST (test_primitive_and_journal, 0, 0);
|
2013-02-18 13:13:01 -05:00
|
|
|
|
2013-03-09 15:00:53 -05:00
|
|
|
ADD_TEST (test_copy_replace_texture, 0, 0);
|
2013-03-09 14:43:46 -05:00
|
|
|
|
2013-03-26 07:17:55 -04:00
|
|
|
ADD_TEST (test_pipeline_cache_unrefs_texture, 0, 0);
|
2013-09-26 07:02:21 -04:00
|
|
|
ADD_TEST (test_pipeline_shader_state, TEST_REQUIREMENT_GLSL, 0);
|
2013-03-26 08:08:12 -04:00
|
|
|
|
2012-03-16 15:54:13 -04:00
|
|
|
UNPORTED_TEST (test_viewport);
|
2012-02-23 07:30:51 -05:00
|
|
|
|
2019-02-16 08:09:38 -05:00
|
|
|
ADD_TEST (test_euler, 0, 0);
|
2013-05-14 16:26:30 -04:00
|
|
|
ADD_TEST (test_color_hsl, 0, 0);
|
2012-05-17 17:30:37 -04:00
|
|
|
|
2013-01-10 20:13:34 -05:00
|
|
|
ADD_TEST (test_fence, TEST_REQUIREMENT_FENCE, 0);
|
|
|
|
|
2013-06-11 10:57:38 -04:00
|
|
|
ADD_TEST (test_texture_no_allocate, 0, 0);
|
2013-06-11 10:57:37 -04:00
|
|
|
|
2014-01-14 10:52:45 -05:00
|
|
|
ADD_TEST (test_texture_rg, TEST_REQUIREMENT_TEXTURE_RG, 0);
|
|
|
|
|
2012-02-23 07:30:51 -05:00
|
|
|
g_printerr ("Unknown test name \"%s\"\n", argv[1]);
|
|
|
|
|
|
|
|
return 1;
|
2011-05-05 18:34:38 -04:00
|
|
|
}
|