[mutter] tests/clutter: Port timeline-interpolate to current test suite
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] tests/clutter: Port timeline-interpolate to current test suite
- Date: Fri, 5 Jun 2020 21:55:06 +0000 (UTC)
commit 73da901cd3d6b1f421f92948c4b8955b0b02410d
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Wed Mar 25 16:31:41 2020 +0100
tests/clutter: Port timeline-interpolate to current test suite
The error tolerance is increased dramatically to make the test less
flaky when running in CI.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1289
src/tests/clutter/conform/meson.build | 1 +
src/tests/clutter/conform/timeline-interpolate.c | 27 +++++++++++++-----------
2 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/src/tests/clutter/conform/meson.build b/src/tests/clutter/conform/meson.build
index 82ce922f77..fbaa46bd37 100644
--- a/src/tests/clutter/conform/meson.build
+++ b/src/tests/clutter/conform/meson.build
@@ -34,6 +34,7 @@ clutter_conform_tests_general_tests = [
'interval',
'script-parser',
'timeline',
+ 'timeline-interpolate',
'units',
]
diff --git a/src/tests/clutter/conform/timeline-interpolate.c
b/src/tests/clutter/conform/timeline-interpolate.c
index 3988c038dd..e60f72b2ef 100644
--- a/src/tests/clutter/conform/timeline-interpolate.c
+++ b/src/tests/clutter/conform/timeline-interpolate.c
@@ -1,8 +1,9 @@
+#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include <stdlib.h>
#include <glib.h>
#include <clutter/clutter.h>
-#include "test-conform-common.h"
+#include "tests/clutter-test-utils.h"
/* We ask for 1 frame per millisecond.
* Whenever this rate can't be achieved then the timeline
@@ -12,8 +13,12 @@
#define TEST_TIMELINE_DURATION 5000
/* We are at the mercy of the system scheduler so this
- * may not be a very reliable tolerance. */
-#define TEST_ERROR_TOLERANCE 20
+ * may not be a very reliable tolerance.
+ *
+ * It's set as very tolerable as otherwise CI, which are
+ * very prone to not get CPU time scheduled, tend to often fail.
+ */
+#define TEST_ERROR_TOLERANCE 150
typedef struct _TestState
{
@@ -118,19 +123,13 @@ completed_cb (ClutterTimeline *timeline,
if (state->completion_count == 2)
{
if (state->passed)
- {
- g_test_message ("Passed\n");
- clutter_main_quit ();
- }
+ clutter_main_quit ();
else
- {
- g_test_message ("Failed\n");
- exit (EXIT_FAILURE);
- }
+ g_assert_not_reached ();
}
}
-void
+static void
timeline_interpolation (void)
{
TestState state;
@@ -159,3 +158,7 @@ timeline_interpolation (void)
g_object_unref (state.timeline);
}
+
+CLUTTER_TEST_SUITE (
+ CLUTTER_TEST_UNIT ("/timeline/interpolate", timeline_interpolation)
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]