Commit Graph

777 Commits

Author SHA1 Message Date
Damien Lespiau ea40bf88bc tests: Use pkg-config to find setbacklight CFLAGS and libs
setbacklight depends on udev and drm, one cannot just add the -l flags
if you want to support unusual install paths.
2012-07-25 10:40:11 -04:00
Kristian Høgsberg 5085001f82 tests: Handle modifier event in test-client.c
We need the handle the newly added modifiers event.

https://bugs.freedesktop.org/show_bug.cgi?id=51567
2012-07-09 22:17:03 -04:00
Kristian Høgsberg 325b3d16ce tests: Add weston-test to EXTRA_DIST 2012-06-25 17:50:22 -04:00
Kristian Høgsberg c3a13cc6cf tests: Use weston_surface_to_global_float
Forgot to update use of weston_surface_to_global() here.
2012-06-09 08:46:51 -04:00
Daniel Stone b7452fe313 Add support for wl_keyboard::keymap events
These keymap events communicate the keymap from the compositor to the
clients via fd passing, rather than having the clients separately
compile a map.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-06-01 11:14:51 -04:00
Daniel Stone 2fce4028d6 Convert wl_pointer::axis to wl_fixed_t
To go with the matching protocol change.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:45:25 -04:00
Daniel Stone 4dbadb1556 Use enum wl_pointer_button_state instead of integer
Instead of using a uint32_t for state everywhere (except on the wire,
where that's still the call signature), use the new
wl_pointer_button_state enum, and explicit comparisons.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:47 -04:00
Daniel Stone 11d7139989 test-client.c: Replace hard-coded magic value
Took me a second to work out that the 272 was actually BTN_LEFT, as keys
and buttons share a namespace in evdev.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-31 15:42:25 -04:00
Pekka Paalanen daed3bc1aa tests, wcap: update ignores
Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-05-31 13:53:57 -04:00
Kristian Høgsberg 870461997a tests: Rename left-over caps_mask to capability 2012-05-17 09:09:21 -04:00
Daniel Stone 37816df646 Convert wl_input_device to wl_seat (and friends)
wl_input_device has been both renamed and split.  wl_seat is now a
virtual object representing a group of logically related input devices
with related focus.

It now only generates one event: to let clients know that it has new
capabilities.  It takes requests which hand back objects for the
wl_pointer, wl_keyboard and wl_touch interfaces it exposes which all
provide the old input interface, just under different names.

This commit tracks these changes in weston and the clients, as well as
similar renames (e.g. weston_input_device -> weston_seat).  Some other
changes were necessary, e.g. renaming the name for the visible mouse
sprite from 'pointer' to 'cursor' so as to not conflict.

For simplicity, every seat is always exposed with all three interfaces,
although this will change as time goes on.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-16 15:29:06 -04:00
Ander Conselvan de Oliveira 6d2030dabb tests: Fix event-test
notify_motion() now receives coordinates in wl_fixed_t but the test was
still passing integers.
2012-05-15 10:59:11 -04:00
Daniel Stone 103db7fb56 Convert wire input co-ordinates to fixed-point
To add greater precision when working with transformed surfaces and/or
high-resolution input devices.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 14:41:01 -04:00
Daniel Stone b230a7ee58 Convert internal input co-ordinates to GLfloat
Change all client motion handlers to take GLfloat for co-ordinates,
rather than int32_t.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-08 14:40:57 -04:00
Daniel Stone 7ceeb7dd43 test-client: Include poll.h to silence warning
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
2012-05-07 10:59:08 -04:00
Kristian Høgsberg 3018b4431b tests: Add event-test, which tests for a few incoming events
We check that we get surface.enter_output and move the pointer into
the window and make sure we get input_device.pointer_enter with
the right coordinates.

There's a lot of code for a very simple test here, so we need to
figure out how to reuse most of the event handling and such.  It's also
not clear that a custom, text based protocol is practical here, we might
just use a wayland extension after all.
2012-04-27 15:03:06 -04:00
Kristian Høgsberg dd90921d87 tests: Generalize test client and add helpers for launching it 2012-04-27 11:15:58 -04:00
Kristian Høgsberg 915b7f8945 tests: Add test case for basic client lifecycle 2012-04-26 10:18:24 -04:00
Kristian Høgsberg 306e36185c tests: Add an initial weston integration test
The idea here is to make weston load test cases as a module and then
run test cases from within weston.
2012-04-26 09:07:13 -04:00
Kristian Høgsberg 6412718c0d Always build tests
There are no dependencies or requirements there that we don't already
need for weston itself.  So lets just always build them.

Use check_PROGRAMS for the matrix unit test case.
2012-04-11 09:38:32 -04:00
Casey Dahlin 476168ea05 weston: update .gitignore files
Updates the .gitignore files for clients and tests to reflect a new test and a
couple of renamed applications.

Signed-off-by: Casey Dahlin <cdahlin@redhat.com>
2012-04-11 08:24:35 -04:00
Tiago Vignatti 1b079abe0e tests: add backlight test
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
2012-03-20 22:43:54 -04:00
Kristian Høgsberg 010f98b083 window: Track and report input and opaque regions
We just set the input region to the bounding box of the window frame
and set the opaque region to be the opaque rectangle inside the window
if the child widget is opaque.
2012-02-23 17:30:54 -05:00
Kristian Høgsberg becfcbfbd2 test: Fix out-of-tree builds 2012-01-30 19:17:52 -05:00
Ander Conselvan de Oliveira a7ef5c85d8 build: fix build of matrix test
This test uses files from src/ so use COMPOSITOR_CFLAGS to find headers
in non-standard locations.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2012-01-30 19:17:17 -05:00
Pekka Paalanen d1f0ab6343 compositor: simplify the matrix inversion API
The compositor will likely do an order of magnitude less matrix
inversions than point transformations with an inverse, hence we do not
really need the optimised path for single-shot invert-and-transform.

Expose only the computing of the explicit inverse matrix in the API.

However, the matrix inversion tests need access to the internal
functions. Designate a unit test build by #defining UNIT_TEST, and
export the internal functions in that case.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 10:44:22 +02:00
Pekka Paalanen 4520d5cafb tests: add matrix-test
Add a new directory tests/ for unit test applications. This directory
will be built only if --enable-tests is given to ./configure.

Add matrix-test application. It excercises especially the
weston_matrix_invert() and weston_matrix_inverse_transform() functions.
It has one test for correctness and precision, and other tests for
measuring the speed of various matrix operations.

For the record, the correctness test prints:

a random matrix:
   1.112418e-02   2.628150e+00   8.205844e+02  -1.147526e-04
   4.943677e-04  -1.117819e-04  -9.158849e-06   3.678122e-02
   7.915063e-03  -3.093254e-04  -4.376583e+02   3.424706e-02
  -2.504038e+02   2.481788e+03  -7.545445e+01   1.752909e-03

The matrix multiplied by its inverse, error:
   0.000000e+00  -0.000000e+00  -0.000000e+00  -0.000000e+00
   0.000000e+00   0.000000e+00   0.000000e+00   0.000000e+00
  -0.000000e+00  -0.000000e+00   0.000000e+00  -0.000000e+00
   0.000000e+00   0.000000e+00   0.000000e+00   0.000000e+00
max abs error: 0, original determinant 11595.2

Running a test loop for 10 seconds...
test fail, det: -0.00464805, error sup: inf
test fail, det: -0.0424053, error sup: 1.30787e-06
test fail, det: 5.15191, error sup: 1.15956e-06
tests: 6791767 ok, 1 not invertible but ok, 3 failed.
Total: 6791771 iterations.

These results are expected with the current precision thresholds in
src/matrix.c and tests/matrix-test.c. The random number generator is
seeded with a constant, so the random numbers should be the same on
every run. Machine speed and scheduling affect how many iterations are
run.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-27 10:44:22 +02:00