mirror of
https://github.com/brl/mutter.git
synced 2024-11-26 01:50:42 -05:00
conform: Move the Score test to the conformance suite
The interactive test for ClutterScore is really meant to be run as part of the conformance test suite, so we should move it there.
This commit is contained in:
parent
a20a509584
commit
00eb71b89a
1
tests/conform/.gitignore
vendored
1
tests/conform/.gitignore
vendored
@ -90,6 +90,7 @@
|
||||
/test-script-single
|
||||
/test-script-child
|
||||
/test-list-model-from-script
|
||||
/test-score
|
||||
/test-script-implicit-alpha
|
||||
/test-script-object-property
|
||||
/test-script-animation
|
||||
|
@ -58,6 +58,7 @@ test_conformance_SOURCES = \
|
||||
test-animator.c \
|
||||
test-state.c \
|
||||
test-clutter-texture.c \
|
||||
test-score.c \
|
||||
$(NULL)
|
||||
|
||||
# For convenience, this provides a way to easily run individual unit tests:
|
||||
|
@ -111,6 +111,8 @@ main (int argc, char **argv)
|
||||
TEST_CONFORM_SKIP (!g_test_slow (), "/timeline", test_timeline_interpolate);
|
||||
TEST_CONFORM_SKIP (!g_test_slow (), "/timeline", test_timeline_rewind);
|
||||
|
||||
TEST_CONFORM_SIMPLE ("/score", test_score);
|
||||
|
||||
TEST_CONFORM_SIMPLE ("/picking", test_pick);
|
||||
|
||||
TEST_CONFORM_SIMPLE ("/text", test_text_utf8_validation);
|
||||
|
@ -1,34 +1,32 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <gmodule.h>
|
||||
#include <clutter/clutter.h>
|
||||
|
||||
static gint level = 1;
|
||||
#include "test-conform-common.h"
|
||||
|
||||
static guint level = 0;
|
||||
|
||||
static void
|
||||
on_score_started (ClutterScore *score)
|
||||
{
|
||||
g_print ("Score started\n");
|
||||
if (g_test_verbose ())
|
||||
g_print ("Score started\n");
|
||||
}
|
||||
|
||||
static void
|
||||
on_score_completed (ClutterScore *score)
|
||||
{
|
||||
g_print ("Score completed\n");
|
||||
clutter_main_quit ();
|
||||
if (g_test_verbose ())
|
||||
g_print ("Score completed\n");
|
||||
}
|
||||
|
||||
static void
|
||||
on_timeline_started (ClutterScore *score,
|
||||
ClutterTimeline *timeline)
|
||||
{
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < level; i++)
|
||||
g_print (" ");
|
||||
|
||||
g_print ("Started timeline: '%s'\n",
|
||||
(gchar *) g_object_get_data (G_OBJECT (timeline), "timeline-name"));
|
||||
if (g_test_verbose ())
|
||||
g_print ("Started timeline: '%s'\n",
|
||||
(gchar *) g_object_get_data (G_OBJECT (timeline), "timeline-name"));
|
||||
|
||||
level += 1;
|
||||
}
|
||||
@ -37,19 +35,16 @@ static void
|
||||
on_timeline_completed (ClutterScore *score,
|
||||
ClutterTimeline *timeline)
|
||||
{
|
||||
gint i;
|
||||
if (g_test_verbose ())
|
||||
g_print ("Completed timeline: '%s'\n",
|
||||
(gchar *) g_object_get_data (G_OBJECT (timeline), "timeline-name"));
|
||||
|
||||
level -= 1;
|
||||
|
||||
for (i = 0; i < level; i++)
|
||||
g_print (" ");
|
||||
|
||||
g_print ("Completed timeline: '%s'\n",
|
||||
(gchar *) g_object_get_data (G_OBJECT (timeline), "timeline-name"));
|
||||
}
|
||||
|
||||
G_MODULE_EXPORT int
|
||||
test_score_main (int argc, char **argv)
|
||||
void
|
||||
test_score (TestConformSimpleFixture *fixture,
|
||||
gconstpointer data)
|
||||
{
|
||||
ClutterScore *score;
|
||||
ClutterTimeline *timeline_1;
|
||||
@ -59,30 +54,31 @@ test_score_main (int argc, char **argv)
|
||||
ClutterTimeline *timeline_5;
|
||||
GSList *timelines;
|
||||
|
||||
clutter_init (&argc, &argv);
|
||||
/* this is necessary to make the master clock spin */
|
||||
(void) clutter_stage_get_default ();
|
||||
|
||||
timeline_1 = clutter_timeline_new (1000);
|
||||
timeline_1 = clutter_timeline_new (100);
|
||||
g_object_set_data_full (G_OBJECT (timeline_1),
|
||||
"timeline-name", g_strdup ("Timeline 1"),
|
||||
g_free);
|
||||
|
||||
timeline_2 = clutter_timeline_new (1000);
|
||||
clutter_timeline_add_marker_at_time (timeline_2, "foo", 500);
|
||||
timeline_2 = clutter_timeline_new (100);
|
||||
clutter_timeline_add_marker_at_time (timeline_2, "foo", 50);
|
||||
g_object_set_data_full (G_OBJECT (timeline_2),
|
||||
"timeline-name", g_strdup ("Timeline 2"),
|
||||
g_free);
|
||||
|
||||
timeline_3 = clutter_timeline_new (1000);
|
||||
timeline_3 = clutter_timeline_new (100);
|
||||
g_object_set_data_full (G_OBJECT (timeline_3),
|
||||
"timeline-name", g_strdup ("Timeline 3"),
|
||||
g_free);
|
||||
|
||||
timeline_4 = clutter_timeline_new (1000);
|
||||
timeline_4 = clutter_timeline_new (100);
|
||||
g_object_set_data_full (G_OBJECT (timeline_4),
|
||||
"timeline-name", g_strdup ("Timeline 4"),
|
||||
g_free);
|
||||
|
||||
timeline_5 = clutter_timeline_new (1000);
|
||||
timeline_5 = clutter_timeline_new (100);
|
||||
g_object_set_data_full (G_OBJECT (timeline_5),
|
||||
"timeline-name", g_strdup ("Timeline 5"),
|
||||
g_free);
|
||||
@ -114,14 +110,10 @@ test_score_main (int argc, char **argv)
|
||||
|
||||
clutter_score_start (score);
|
||||
|
||||
clutter_main ();
|
||||
|
||||
g_object_unref (timeline_1);
|
||||
g_object_unref (timeline_2);
|
||||
g_object_unref (timeline_3);
|
||||
g_object_unref (timeline_4);
|
||||
g_object_unref (timeline_5);
|
||||
g_object_unref (score);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
1
tests/interactive/.gitignore
vendored
1
tests/interactive/.gitignore
vendored
@ -19,7 +19,6 @@
|
||||
/test-project
|
||||
/test-rotate
|
||||
/test-scale
|
||||
/test-score
|
||||
/test-script
|
||||
/test-shader
|
||||
/test-text
|
||||
|
@ -13,7 +13,6 @@ UNIT_TESTS = \
|
||||
test-rotate.c \
|
||||
test-depth.c \
|
||||
test-threads.c \
|
||||
test-score.c \
|
||||
test-script.c \
|
||||
test-model.c \
|
||||
test-grab.c \
|
||||
|
Loading…
Reference in New Issue
Block a user