Commit Graph

412 Commits

Author SHA1 Message Date
Emmanuele Bassi
1d7f3260a6 conform: Run texture tests only on -m=slow
I don't want to remove them altogether, but they need to be ported to a
more reliable system, otherwise they end up failing at random depending
on the whims of the compositor and the windowing system.
2013-12-04 16:07:18 +00:00
Bastian Winkler
e56785501b interval: Implement ClutterScriptable interface
This allows the creation of ClutterTransition objects in ClutterScript:
 {
   "id" : "scripted-transition",
   "type" : "ClutterPropertyTransition",
   "property-name" : "background-color",
   "interval" : {
     "type" : "ClutterInterval",
     "value-type" : "ClutterColor",
     "initial" : "red",
     "final" : "blue"
   }
 }
2013-11-14 18:34:40 +00:00
Jasper St. Pierre
8db571ff54 tests: Fix compiler warnings 2013-08-27 08:47:16 -04:00
Emmanuele Bassi
fa72540246 build: Ensure tests are built only on make check
Tests should only be enabled when we want to run them, or when we are
generating a tarball.
2013-08-19 23:22:38 +01:00
Emmanuele Bassi
edb6e66d90 build: Fix distcheck for conformance tests
We need to export G_TEST_SRCDIR and G_TEST_BUILDDIR if we want to be
able to build the path to the tests data.
2013-07-10 12:31:32 +01:00
Emmanuele Bassi
52e0ec92b7 build: Remove the wrappers directory on clean 2013-07-04 15:48:39 +01:00
Emmanuele Bassi
575b77210b build: Add *.test pattern to the ignored files list 2013-07-03 13:08:26 +01:00
Emmanuele Bassi
f1769d9423 conform/actor-layout: Remove the continuous redraw
We just need one paint cycle.
2013-07-02 23:21:45 +01:00
Emmanuele Bassi
3dad01ac22 conform: Drop the Cogl tests
Cogl has its own (way, way better) test suite these days, so we can drop
our own units here.
2013-07-02 22:36:11 +01:00
Emmanuele Bassi
1124fa9a10 conform: Drop the TODO macro from the harness
The TODO macro is barely used, and it's implemented in terms of
deprecated, not portable API. Let's drop it.
2013-07-02 22:33:58 +01:00
Emmanuele Bassi
4a05ac34fc build: Disable Cogl deprecation warnings for tests
We are exercising all sorts of deprecated API anyway.
2013-07-02 22:26:49 +01:00
Emmanuele Bassi
4787ae2f63 conform: Move timeline-base under conditional check
The timeline base test unit is pretty slow, and under heavy load it will
tend to fail because of skipped frames. We should put it under
conditional testing and only run it if `-m slow` is passed to the test
harness.
2013-07-02 22:23:26 +01:00
Emmanuele Bassi
f1971844b9 conform: Use a repaint function
Timeouts and idles are subject to the whims of the load of the machine
running the tests, as we found out with the new installed tests and
OSTree-based VM running the conformance test suite continuously.

We should be able to use a repaint function and a blocking loop that
either is terminated because we hit g_assert(), or because a flag gets
toggled once we know that the Stage has been at least painted once.

The currently enabled tests using clutter_stage_read_pixels() have been
updated to this approach.

https://bugzilla.gnome.org/show_bug.cgi?id=703476
2013-07-02 22:23:26 +01:00
Colin Walters
8ac9346046 tests/conform/texture-fbo: Log failure better
We might as well print out exactly which assertion failed.
2013-06-24 20:30:40 +01:00
Emmanuele Bassi
de20785b1b conform: Conditionally execute the texture-fbo unit
If we don't have support for offscreen buffers, then there's no point in
testing FBO support in ClutterTexture — a feature that has been long
since deprecated, on a deprecated class.
2013-06-24 19:43:44 +01:00
Matthias Clasen
e98f32b7c8 Install conformance tests
Install the conformance tests, and metadata to run them
with gnome-desktop-testing-runner.

https://bugzilla.gnome.org/show_bug.cgi?id=702941
2013-06-23 23:28:19 -04:00
Emmanuele Bassi
150090c19b conform: Ensure that we don't leak references
Especially on actors that are not parented and get destroyed.
2013-06-12 10:27:37 +01:00
Emmanuele Bassi
caf6959195 conform: Add suite for actor's meta objects 2013-06-12 10:04:32 +01:00
Emmanuele Bassi
0065fb459c Revert "units: Handle negative values in clutter_units_from_string()"
Stray commit got pushed too soon.

This reverts commit 44f283bb72.
2013-05-22 14:34:22 +01:00
Bastian Winkler
44f283bb72 units: Handle negative values in clutter_units_from_string()
In order to allow values like "-2cm" in ClutterScript,
clutter_units_from_string() needs to handle negative values as well.
2013-05-22 15:26:12 +02:00
Emmanuele Bassi
323ec19dcc build: Remove INCLUDES directives
They have been deprecated for a while, replaced by AM_CPPFLAGS.
2013-05-15 15:18:13 +01:00
Emmanuele Bassi
c9583792cb build: Fix up the silent rules prefixes
Automake increased the whitespace, so we need to do that for our "I
Can't Believe It's Not Autotool™" rules.
2013-05-15 15:07:15 +01:00
Lionel Landwerlin
d1041e1f4f conform: add offscreen effects fbo size check
https://bugzilla.gnome.org/show_bug.cgi?id=699675
2013-05-15 14:58:46 +01:00
Emmanuele Bassi
160c62b2f9 conform: Disable the Cogl tests
Cogl is being tested pretty well, these days; also, there is a failure
in the mipmap test that I really don't have time to bisect.
2013-02-20 23:31:17 +00:00
Rob Bradford
6bef2cff19 conformance: Only check for DISPLAY on X11 windowing backend
Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=693741
2013-02-20 23:06:28 +00:00
Emmanuele Bassi
65a024af92 timeline: Add progress-based marker API
Being able to set a marker at a normalized point on a timeline, instead
of using a specific time, is a nice fit with the current Timeline class
API.

https://bugzilla.gnome.org/show_bug.cgi?id=694319
2013-02-20 23:06:28 +00:00
Emanuele Aina
219d0efcc6 actor: rollback pivot translation even on explicit transforms
When setting an explicit transform with clutter_actor_set_transform()
and a non (0,0) pivot-point, clutter_actor_apply_transform() will fail
to roll back the pivot-point translation done before multiplying the
transformation matrix due to the "out:" label being slightly misplaced
in clutter_actor_real_apply_transform().

This works properly:
  clutter_actor_set_pivot_point (actor, 0.5, 0.5);
  clutter_actor_set_rotation_angle (actor, CLUTTER_Z_AXIS, 30);

This results in the actor being moved to the pivot-point position:
  clutter_actor_set_pivot_point (actor, 0.5, 0.5);
  clutter_matrix_init_identity(&matrix);
  cogl_matrix_rotate (&matrix, 30, 0, 0, 1.0);
  clutter_actor_set_transform (actor, &matrix);

This also add a conformance test checking that even when using a
pivot-point, no matter how a rotation is set the resulting
transformation matrix will be the same.

https://bugzilla.gnome.org/show_bug.cgi?id=690214
2012-12-14 19:15:48 +01:00
Daniel Stone
13d889814c test: Only run X11-specific code when using X11
The X11-specific windowing checks were hidden behind an #ifdef, however
if the tests were run under Wayland, they would execute uncondionally
and cause assertion failures.  Fix this by also hiding them behind a
check that the current backend is indeed X11.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-10-12 15:12:55 +01:00
Emmanuele Bassi
41ed9023eb build: Fix out of tree builds 2012-07-30 12:33:24 +01:00
Emmanuele Bassi
4546f84408 timeline: Add support for step() progress
The CSS3 Transitions specification from the W3C defines the possibility
of using a parametrized step() timing function, with the following
prototype:

        steps(n_steps, [ start | end ])

where @n_steps represents the number of steps used to divide an interval
between 0 and 1; the 'start' and 'end' tokens describe whether the value
change should happen at the start of the transition, or at the end.

For instance, the "steps(3, start)" timing function has the following
profile:

  1 |           x
    |           |
    |       x---|
    |       '   |
    |   x---'   |
    |   '       |
  0 |---'       |

Whereas the "steps(3, end)" timing function has the following profile:

  1 |       x---|
    |       '   |
    |   x---'   |
    |   '       |
    x---'       |
    |           |
  0 |           |

Since ClutterTimeline uses an enumeration for controlling the progress
mode, we need additional API to define the parameters of the steps()
progress; for this reason, we need a CLUTTER_STEPS enumeration value,
and a method for setting the number of steps and the value transition
policy.

The CSS3 Transitions spec helpfully also defines a step-start and a
step-end shorthands, which expand to step(1, start) and step(1, end)
respectively; we can provide a CLUTTER_STEP_START and CLUTTER_STEP_END
enumeration values for those.
2012-07-19 20:47:00 -04:00
Emmanuele Bassi
1da42dd8a0 actor: Add ActorIter.is_valid()
It can be useful to check whether a ClutterActorIter is currently valid,
i.e. if the iterator has been initialized *and* if the actor to which it
refers to hasn't been updated.

We can also use the is_valid() method in the conformance test suite to
check that initialization has been successful, and that changing the
children list through the ClutterActorIter API leaves the iterator in a
valid state.
2012-06-27 21:28:01 +01:00
Emmanuele Bassi
1ca4937f1e conform: Check that iterators work post-assignment
It should be possible to copy a ClutterActorIter just by copying its
contents (either via assignment or memcpy).
2012-06-27 21:28:01 +01:00
Emmanuele Bassi
98982331cb conform/script: Add the return type for the margin test
The compiler would default to 'int', and warn - and then warn again
because the function would not return a value.
2012-06-20 18:58:31 +01:00
Emmanuele Bassi
47f8be4d4b conform: Put xinput enabling under guards
Calling clutter_x11_* API should be done only under the platform
specific guards we provide with Clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=678423
2012-06-20 08:53:46 +01:00
Emmanuele Bassi
c57cabd4c2 conform/interval: Add transformation unit test
Verify that it's possible to pass a transformable type to
ClutterInterval.
2012-06-18 18:04:54 +01:00
Emmanuele Bassi
aacd28cc21 conform: Initial suite for ClutterInterval
ClutterInterval is undertested, so we should start adding a unit test
for it.
2012-06-18 18:04:54 +01:00
Frédéric Péters
a88f73091b tests: link test-conformance against libm
https://bugzilla.gnome.org/show_bug.cgi?id=677921
2012-06-15 15:30:24 +01:00
Tomeu Vizoso
b4222db71d tests: Make sure we return 0 only on error 2012-06-14 11:17:05 +02:00
Emmanuele Bassi
1ab6fc0b39 conform/events-touch: Silently bail out if init failed
This removes the need to conditionally run the test.
2012-06-07 12:23:49 +01:00
Tomeu Vizoso
b339b845cb tests: Add unit test for touch event handling
For now, it just generates a simple horizontal slide (by writing
to /dev/uinput) and checks that the stage gets the events at the
expected coordinates.

The test won't run if it doesn't have read/write permissions to
/dev/uinput.

It also adds OS_LINUX to config.h.
2012-06-07 12:12:56 +02:00
Bastian Winkler
aeea9ee778 actor: Add a custom scriptable "margin" property
The property uses an array with the following CSS style syntax

 [ top, right, bottom, left ] or
 [ top, left/right, bottom ] or
 [ top/bottom, left/right ] or
 [ top/right/bottom/left ]

https://bugzilla.gnome.org/show_bug.cgi?id=676367
2012-05-21 15:31:34 +02:00
Emmanuele Bassi
dd3c66579b conform/actor-graph: Add missing NULL terminator 2012-05-01 13:30:27 +01:00
Emmanuele Bassi
0fca11ec2f path: Avoid integer overflow in get_distance()
The get_distance() API uses machine integers to compute the distance;
this means that on 32bit we can overflow the integer size. This gets
hidden by the fact that get_distance() returns an unsigned integer as
well.

In reality, ClutterPath is an unmitigated mess, and the only way to
actually fix it is to break API.

https://bugzilla.gnome.org/show_bug.cgi?id=652521
2012-04-27 12:28:49 +01:00
Jasper St. Pierre
85323f09a5 conform: Make sure that raising/lowering children doesn't change state
Namely, visibility and show-on-set-parent.

https://bugzilla.gnome.org/show_bug.cgi?id=674510
2012-04-24 11:25:42 -04:00
Neil Roberts
c9a81f035e Don't use any GL types or defines in Clutter
Some of the Clutter code was using GL types for the primitive types
such as GLint and GLubyte and then passing these to Cogl. This doesn't
make much sense because the Cogl functions directly take native C
types. This patch just replaces them with either a native C type or a
glib type.

Some of the cogl conformance tests are trying to directly call GL for
example to test creating a foreign texture. These tests have been
changed to manually define the GL enum values instead of relying on a
GL header to define them.

This is necessary because Cogl may soon stop including a GL header
from its public headers.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2012-03-23 17:24:42 +00:00
Emmanuele Bassi
6a502f7104 conform: Set harsher environment for running tests
Set the MALLOC_CHECK_ and MALLOC_PERTURB_ environment variables to catch
allocation issues.
2012-03-20 16:19:23 +00:00
Emmanuele Bassi
767b14fb2d conform/anchors: Fix a dubious test
Changing the scale gravity should not affect the scale factors as well;
it was just a side-effect of the wrong implementation of the setter.
2012-03-19 14:47:55 +00:00
Emmanuele Bassi
10e2f551f5 actor: Unconditionally emit ::paint
It's a bit late in the game for changing the emission of the paint
signal with actors that use paint nodes - mostly because we have both
implicit paint nodes (background color, content) and explicit paint
nodes (the paint_node virtual).

When we branch for 1.12 we can revert this change.
2012-03-16 12:33:39 +00:00
Emmanuele Bassi
74765404dd conform: Skip actor-offscreen-redirect
Until we figure out a way to make it succeed even without the paint
signal emission.
2012-03-16 12:33:37 +00:00
Emmanuele Bassi
485b720a54 conform/text-cache: Use the stage paint signal
The stage's paint signal is guaranteed to be emitted; ClutterText's
paint signal is not.
2012-03-16 12:33:37 +00:00