"Initial commit to Gerrit"
[profile/ivi/cogl.git] / tests / conform / test-conform-main.c
1 #include "config.h"
2
3 #include <cogl/cogl.h>
4
5 #include <glib.h>
6 #include <locale.h>
7 #include <stdlib.h>
8 #include <string.h>
9
10 #include "test-utils.h"
11
12 /* A bit of sugar for adding new conformance tests */
13 #define ADD_TEST(FUNC, REQUIREMENTS)  G_STMT_START {      \
14   extern void FUNC (void);                                \
15   if (strcmp (#FUNC, argv[1]) == 0)                       \
16     {                                                     \
17       test_utils_init (REQUIREMENTS);                     \
18       FUNC ();                                            \
19       test_utils_fini ();                                 \
20       exit (0);                                           \
21     }                                                     \
22 } G_STMT_END
23
24 #define UNPORTED_TEST(FUNC)
25
26 int
27 main (int argc, char **argv)
28 {
29   int i;
30
31   if (argc != 2)
32     {
33       g_printerr ("usage %s UNIT_TEST\n", argv[0]);
34       exit (1);
35     }
36
37   /* Just for convenience in case people try passing the wrapper
38    * filenames for the UNIT_TEST argument we normalize '-' characters
39    * to '_' characters... */
40   for (i = 0; argv[1][i]; i++)
41     {
42       if (argv[1][i] == '-')
43         argv[1][i] = '_';
44     }
45
46   /* This file is run through a sed script during the make step so the
47    * lines containing the tests need to be formatted on a single line
48    * each.
49    */
50
51   UNPORTED_TEST (test_object);
52   UNPORTED_TEST (test_fixed);
53   UNPORTED_TEST (test_materials);
54   ADD_TEST (test_pipeline_user_matrix, 0);
55   ADD_TEST (test_blend_strings, 0);
56   UNPORTED_TEST (test_premult);
57   UNPORTED_TEST (test_readpixels);
58   ADD_TEST (test_path, 0);
59   ADD_TEST (test_depth_test, 0);
60   ADD_TEST (test_color_mask, 0);
61   ADD_TEST (test_backface_culling, TEST_REQUIREMENT_NPOT);
62
63   ADD_TEST (test_sparse_pipeline, 0);
64
65   UNPORTED_TEST (test_npot_texture);
66   UNPORTED_TEST (test_multitexture);
67   UNPORTED_TEST (test_texture_mipmaps);
68   ADD_TEST (test_sub_texture, 0);
69   ADD_TEST (test_pixel_buffer, 0);
70   UNPORTED_TEST (test_texture_rectangle);
71   ADD_TEST (test_texture_3d, 0);
72   ADD_TEST (test_wrap_modes, 0);
73   UNPORTED_TEST (test_texture_pixmap_x11);
74   UNPORTED_TEST (test_texture_get_set_data);
75   UNPORTED_TEST (test_atlas_migration);
76   ADD_TEST (test_read_texture_formats, 0);
77   ADD_TEST (test_write_texture_formats, 0);
78
79   UNPORTED_TEST (test_vertex_buffer_contiguous);
80   UNPORTED_TEST (test_vertex_buffer_interleved);
81   UNPORTED_TEST (test_vertex_buffer_mutability);
82
83   ADD_TEST (test_primitive, 0);
84
85   ADD_TEST (test_just_vertex_shader, 0);
86   ADD_TEST (test_pipeline_uniforms, 0);
87   ADD_TEST (test_snippets, 0);
88   ADD_TEST (test_custom_attributes, 0);
89
90   ADD_TEST (test_bitmask, 0);
91
92   ADD_TEST (test_offscreen, 0);
93
94   ADD_TEST (test_point_size, 0);
95   ADD_TEST (test_point_sprite,
96             TEST_KNOWN_FAILURE | TEST_REQUIREMENT_POINT_SPRITE);
97
98   UNPORTED_TEST (test_viewport);
99
100   g_printerr ("Unknown test name \"%s\"\n", argv[1]);
101
102   return 1;
103 }