3 #include <clutter/clutter.h>
6 #ifdef CLUTTER_WINDOWING_X11
8 #include <clutter/x11/clutter-x11.h>
11 #include "test-conform-common.h"
14 * test_conform_simple_fixture_setup:
16 * Initialise stuff before each test is run
19 test_conform_simple_fixture_setup (TestConformSimpleFixture *fixture,
22 const TestConformSharedState *shared_state = data;
23 static int counter = 0;
26 g_critical ("We don't support running more than one test at a time\n"
27 "in a single test run due to the state leakage that often\n"
28 "causes subsequent tests to fail.\n"
30 "If you want to run all the tests you should run\n"
31 "$ make test-report");
34 #ifdef HAVE_CLUTTER_GLX
36 /* on X11 we need a display connection to run the test suite */
37 const gchar *display = g_getenv ("DISPLAY");
38 if (!display || *display == '\0')
40 g_print ("No DISPLAY found. Unable to run the conformance "
41 "test suite without a display.\n");
48 g_assert (clutter_init (shared_state->argc_addr, shared_state->argv_addr)
49 == CLUTTER_INIT_SUCCESS);
51 #ifdef CLUTTER_WINDOWING_X11
52 /* A lot of the tests depend on a specific stage / framebuffer size
53 * when they read pixels back to verify the results of the test.
55 * Normally the asynchronous nature of X means that setting the
56 * clutter stage size may really happen an indefinite amount of time
57 * later but since the tests are so short lived and may only render
58 * a single frame this is not an acceptable semantic.
60 XSynchronize (clutter_x11_get_default_display(), TRUE);
66 * test_conform_simple_fixture_teardown:
68 * Cleanup stuff after each test has finished
71 test_conform_simple_fixture_teardown (TestConformSimpleFixture *fixture,
74 /* const TestConformSharedState *shared_state = data; */
78 test_conform_get_gl_functions (TestConformGLFunctions *functions)
80 functions->glGetString = (void *) cogl_get_proc_address ("glGetString");
81 g_assert (functions->glGetString != NULL);
82 functions->glGetIntegerv = (void *) cogl_get_proc_address ("glGetIntegerv");
83 g_assert (functions->glGetIntegerv != NULL);
84 functions->glPixelStorei = (void *) cogl_get_proc_address ("glPixelStorei");
85 g_assert (functions->glPixelStorei != NULL);
86 functions->glBindTexture = (void *) cogl_get_proc_address ("glBindTexture");
87 g_assert (functions->glBindTexture != NULL);
88 functions->glGenTextures = (void *) cogl_get_proc_address ("glGenTextures");
89 g_assert (functions->glGenTextures != NULL);
90 functions->glGetError = (void *) cogl_get_proc_address ("glGetError");
91 g_assert (functions->glGetError != NULL);
92 functions->glDeleteTextures =
93 (void *) cogl_get_proc_address ("glDeleteTextures");
94 g_assert (functions->glDeleteTextures != NULL);
95 functions->glTexImage2D = (void *) cogl_get_proc_address ("glTexImage2D");
96 g_assert (functions->glTexImage2D != NULL);
97 functions->glTexParameteri =
98 (void *) cogl_get_proc_address ("glTexParameteri");
99 g_assert (functions->glTexParameteri != NULL);