#include "cogl-config.h" #include #include #include #include #include #include "test-declarations.h" #include "test-utils.h" /* A bit of sugar for adding new conformance tests */ #define ADD_TEST(FUNC, REQUIREMENTS, KNOWN_FAIL_REQUIREMENTS) \ G_STMT_START { \ if (strcmp (#FUNC, argv[1]) == 0) \ { \ if (test_utils_init (REQUIREMENTS, KNOWN_FAIL_REQUIREMENTS) \ || g_getenv ("COGL_TEST_TRY_EVERYTHING") != NULL) \ { \ FUNC (); \ test_utils_fini (); \ exit (0); \ } \ else \ { \ exit (1); \ } \ } \ } G_STMT_END #define UNPORTED_TEST(FUNC) int main (int argc, char **argv) { int i; if (argc != 2) { g_printerr ("usage %s UNIT_TEST\n", argv[0]); exit (1); } /* 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] = '_'; } /* 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 * each. */ UNPORTED_TEST (test_object); UNPORTED_TEST (test_fixed); UNPORTED_TEST (test_materials); UNPORTED_TEST (test_readpixels); ADD_TEST (test_npot_texture, 0, 0); UNPORTED_TEST (test_multitexture); UNPORTED_TEST (test_texture_mipmaps); UNPORTED_TEST (test_texture_rectangle); UNPORTED_TEST (test_texture_pixmap_x11); ADD_TEST (test_texture_get_set_data, 0, 0); ADD_TEST (test_alpha_textures, 0, 0); UNPORTED_TEST (test_vertex_buffer_contiguous); UNPORTED_TEST (test_vertex_buffer_interleved); UNPORTED_TEST (test_vertex_buffer_mutability); ADD_TEST (test_framebuffer_get_bits, TEST_REQUIREMENT_GL, 0); ADD_TEST (test_alpha_test, 0, 0); ADD_TEST (test_map_buffer_range, TEST_REQUIREMENT_MAP_WRITE, 0); ADD_TEST (test_primitive_and_journal, 0, 0); ADD_TEST (test_copy_replace_texture, 0, 0); ADD_TEST (test_pipeline_cache_unrefs_texture, 0, 0); ADD_TEST (test_pipeline_shader_state, 0, 0); UNPORTED_TEST (test_viewport); ADD_TEST (test_fence, TEST_REQUIREMENT_FENCE, 0); ADD_TEST (test_texture_no_allocate, 0, 0); ADD_TEST (test_texture_rg, TEST_REQUIREMENT_TEXTURE_RG, 0); g_printerr ("Unknown test name \"%s\"\n", argv[1]); return 1; }