2008-11-18 08:06:02 -05:00
|
|
|
#include "config.h"
|
|
|
|
|
2008-11-07 14:32:28 -05:00
|
|
|
#include <clutter/clutter.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "test-conform-common.h"
|
|
|
|
|
2009-02-14 06:41:55 -05:00
|
|
|
static void
|
|
|
|
test_conform_skip_test (TestConformSimpleFixture *fixture,
|
|
|
|
gconstpointer data)
|
|
|
|
{
|
|
|
|
/* void */
|
|
|
|
}
|
2008-11-07 14:32:28 -05:00
|
|
|
|
|
|
|
/* This is a bit of sugar for adding new conformance tests:
|
|
|
|
*
|
|
|
|
* - It adds an extern function definition just to save maintaining a header
|
|
|
|
* that lists test entry points.
|
|
|
|
* - It sets up callbacks for a fixture, which lets us share initialization
|
|
|
|
* *code* between tests. (see test-conform-common.c)
|
|
|
|
* - It passes in a shared *data* pointer that is initialised once in main(),
|
|
|
|
* that gets passed to the fixture setup and test functions. (See the
|
|
|
|
* definition in test-conform-common.h)
|
|
|
|
*/
|
2009-02-14 06:41:55 -05:00
|
|
|
#define TEST_CONFORM_SIMPLE(NAMESPACE, FUNC) G_STMT_START { \
|
2008-11-07 14:32:28 -05:00
|
|
|
extern void FUNC (TestConformSimpleFixture *fixture, gconstpointer data); \
|
|
|
|
g_test_add ("/conform" NAMESPACE "/" #FUNC, \
|
|
|
|
TestConformSimpleFixture, \
|
|
|
|
shared_state, /* data argument for test */ \
|
|
|
|
test_conform_simple_fixture_setup, \
|
|
|
|
FUNC, \
|
2009-02-14 06:41:55 -05:00
|
|
|
test_conform_simple_fixture_teardown); } G_STMT_END
|
2008-11-07 14:32:28 -05:00
|
|
|
|
2009-02-14 06:41:55 -05:00
|
|
|
/* this is a macro that conditionally executes a test if CONDITION
|
|
|
|
* evaluates to TRUE; otherwise, it will put the test under the
|
|
|
|
* "/skip" namespace and execute a dummy function that will always
|
|
|
|
* pass.
|
|
|
|
*/
|
|
|
|
#define TEST_CONFORM_SKIP(CONDITION, NAMESPACE, FUNC) G_STMT_START { \
|
|
|
|
if (CONDITION) { \
|
|
|
|
g_test_add ("/skipped" NAMESPACE "/" #FUNC, \
|
|
|
|
TestConformSimpleFixture, \
|
|
|
|
shared_state, /* data argument for test */ \
|
|
|
|
test_conform_simple_fixture_setup, \
|
|
|
|
test_conform_skip_test, \
|
|
|
|
test_conform_simple_fixture_teardown); \
|
|
|
|
} else { TEST_CONFORM_SIMPLE (NAMESPACE, FUNC); } } G_STMT_END
|
2008-11-07 14:32:28 -05:00
|
|
|
|
2009-02-19 11:51:37 -05:00
|
|
|
#define TEST_CONFORM_TODO(NAMESPACE, FUNC) G_STMT_START { \
|
|
|
|
g_test_add ("/todo" NAMESPACE "/" #FUNC, \
|
|
|
|
TestConformSimpleFixture, \
|
|
|
|
shared_state, \
|
|
|
|
test_conform_simple_fixture_setup, \
|
|
|
|
test_conform_skip_test, \
|
|
|
|
test_conform_simple_fixture_teardown); } G_STMT_END
|
|
|
|
|
2008-11-07 14:32:28 -05:00
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
|
|
|
TestConformSharedState *shared_state = g_new0 (TestConformSharedState, 1);
|
2008-11-18 08:06:02 -05:00
|
|
|
const gchar *display;
|
|
|
|
|
|
|
|
#ifdef HAVE_CLUTTER_GLX
|
|
|
|
/* on X11 we need a display connection to run the test suite */
|
|
|
|
display = g_getenv ("DISPLAY");
|
|
|
|
if (!display || *display == '\0')
|
|
|
|
{
|
|
|
|
g_print ("No DISPLAY found. Unable to run the conformance "
|
|
|
|
"test suite without a display.");
|
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|
|
|
|
#endif
|
2008-11-07 14:32:28 -05:00
|
|
|
|
|
|
|
g_test_init (&argc, &argv, NULL);
|
2009-01-20 16:12:44 -05:00
|
|
|
|
2008-11-07 14:32:28 -05:00
|
|
|
g_test_bug_base ("http://bugzilla.openedhand.com/show_bug.cgi?id=%s");
|
|
|
|
|
|
|
|
g_assert (clutter_init (shared_state->argc_addr, shared_state->argv_addr)
|
|
|
|
== CLUTTER_INIT_SUCCESS);
|
2009-01-20 16:12:44 -05:00
|
|
|
|
2008-11-07 14:32:28 -05:00
|
|
|
/* Initialise the state you need to share with everything.
|
|
|
|
*/
|
|
|
|
shared_state->argc_addr = &argc;
|
|
|
|
shared_state->argv_addr = &argv;
|
2009-01-20 16:12:44 -05:00
|
|
|
|
2008-11-10 06:48:00 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/timeline", test_timeline);
|
2009-02-14 06:41:55 -05:00
|
|
|
TEST_CONFORM_SKIP (!g_test_slow (), "/timeline", test_timeline_dup_frames);
|
|
|
|
TEST_CONFORM_SKIP (!g_test_slow (), "/timeline", test_timeline_dup_frames);
|
|
|
|
TEST_CONFORM_SKIP (!g_test_slow (), "/timeline", test_timeline_interpolate);
|
|
|
|
TEST_CONFORM_SKIP (!g_test_slow (), "/timeline", test_timeline_rewind);
|
|
|
|
TEST_CONFORM_SKIP (!g_test_slow (), "/timeline", test_timeline_smoothness);
|
2009-01-20 16:12:44 -05:00
|
|
|
|
2008-11-07 14:32:28 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/picking", test_pick);
|
|
|
|
|
2008-12-11 06:45:37 -05:00
|
|
|
/* ClutterText */
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_utf8_validation);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_empty);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_set_empty);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_set_text);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_append_some);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_prepend_some);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_insert);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_delete_chars);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_delete_text);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_cursor);
|
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_event);
|
2008-12-11 06:59:50 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_get_chars);
|
2008-12-11 07:13:26 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_cache);
|
2009-01-06 10:30:31 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/text", test_text_password_char);
|
2008-12-11 06:45:37 -05:00
|
|
|
|
2008-11-07 14:32:28 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_size);
|
|
|
|
TEST_CONFORM_SIMPLE ("/rectangle", test_rect_set_color);
|
|
|
|
|
|
|
|
TEST_CONFORM_SIMPLE ("/fixed", test_fixed_constants);
|
2009-01-20 16:12:44 -05:00
|
|
|
|
2008-11-08 10:56:22 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/invariants", test_initial_state);
|
2008-11-18 07:16:00 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/invariants", test_realized);
|
2008-11-08 10:56:22 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/invariants", test_mapped);
|
|
|
|
TEST_CONFORM_SIMPLE ("/invariants", test_show_on_set_parent);
|
|
|
|
|
2009-01-20 16:12:44 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/vertex-buffer", test_vertex_buffer_contiguous);
|
|
|
|
TEST_CONFORM_SIMPLE ("/vertex-buffer", test_vertex_buffer_interleved);
|
|
|
|
TEST_CONFORM_SIMPLE ("/vertex-buffer", test_vertex_buffer_mutability);
|
2008-11-10 13:53:14 -05:00
|
|
|
|
2008-11-12 09:41:01 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/opacity", test_label_opacity);
|
|
|
|
TEST_CONFORM_SIMPLE ("/opacity", test_rectangle_opacity);
|
|
|
|
TEST_CONFORM_SIMPLE ("/opacity", test_paint_opacity);
|
2008-11-07 14:32:28 -05:00
|
|
|
|
2008-11-28 12:36:37 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/texture", test_backface_culling);
|
2009-02-09 07:47:41 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/texture", test_npot_texture);
|
2008-11-28 12:36:37 -05:00
|
|
|
|
2008-12-05 08:13:37 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/path", test_path);
|
|
|
|
|
2008-12-08 08:57:10 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/binding-pool", test_binding_pool);
|
|
|
|
|
2009-01-22 08:14:02 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/actor", test_anchors);
|
|
|
|
|
2009-02-14 06:45:27 -05:00
|
|
|
TEST_CONFORM_SIMPLE ("/model", test_list_model_populate);
|
|
|
|
TEST_CONFORM_SIMPLE ("/model", test_list_model_iterate);
|
2009-04-29 10:39:23 -04:00
|
|
|
TEST_CONFORM_SIMPLE ("/model", test_list_model_filter);
|
2009-02-14 06:45:27 -05:00
|
|
|
|
2008-11-12 09:41:01 -05:00
|
|
|
return g_test_run ();
|
|
|
|
}
|