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 CLUTTER_WINDOWING_X11
35
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
37
/* on X11 we need a display connection to run the test suite */
38
const gchar *display = g_getenv ("DISPLAY");
39
if (!display || *display == '\0')
41
g_print ("No DISPLAY found. Unable to run the conformance "
42
"test suite without a display.\n");
47
/* enable XInput support */
48
clutter_x11_enable_xinput ();
52
g_assert (clutter_init (shared_state->argc_addr, shared_state->argv_addr)
53
== CLUTTER_INIT_SUCCESS);
55
#ifdef CLUTTER_WINDOWING_X11
56
/* A lot of the tests depend on a specific stage / framebuffer size
57
* when they read pixels back to verify the results of the test.
59
* Normally the asynchronous nature of X means that setting the
60
* clutter stage size may really happen an indefinite amount of time
61
* later but since the tests are so short lived and may only render
62
* a single frame this is not an acceptable semantic.
64
if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
65
XSynchronize (clutter_x11_get_default_display(), TRUE);
71
* test_conform_simple_fixture_teardown:
73
* Cleanup stuff after each test has finished
76
test_conform_simple_fixture_teardown (TestConformSimpleFixture *fixture,
79
/* const TestConformSharedState *shared_state = data; */
83
test_conform_get_gl_functions (TestConformGLFunctions *functions)
85
functions->glGetString = (void *) cogl_get_proc_address ("glGetString");
86
g_assert (functions->glGetString != NULL);
87
functions->glGetIntegerv = (void *) cogl_get_proc_address ("glGetIntegerv");
88
g_assert (functions->glGetIntegerv != NULL);
89
functions->glPixelStorei = (void *) cogl_get_proc_address ("glPixelStorei");
90
g_assert (functions->glPixelStorei != NULL);
91
functions->glBindTexture = (void *) cogl_get_proc_address ("glBindTexture");
92
g_assert (functions->glBindTexture != NULL);
93
functions->glGenTextures = (void *) cogl_get_proc_address ("glGenTextures");
94
g_assert (functions->glGenTextures != NULL);
95
functions->glGetError = (void *) cogl_get_proc_address ("glGetError");
96
g_assert (functions->glGetError != NULL);
97
functions->glDeleteTextures =
98
(void *) cogl_get_proc_address ("glDeleteTextures");
99
g_assert (functions->glDeleteTextures != NULL);
100
functions->glTexImage2D = (void *) cogl_get_proc_address ("glTexImage2D");
101
g_assert (functions->glTexImage2D != NULL);
102
functions->glTexParameteri =
103
(void *) cogl_get_proc_address ("glTexParameteri");
104
g_assert (functions->glTexParameteri != NULL);