tests: add code for creating and running tests

use mixture of wayland's test suite and glib (save list of tests in special
section and run them using glib)
There are two types of tests (due to efficency):
TEST(test_name) is usual test that do not need mutter and
MUTTER_TEST(test_name) is test that will be run along with mutter
Also, each of these types has FAIL variant, that suppose that the
test should fail.
tests: affect spawning mutter by environment variable

Environment variable MUTTER_TEST_SPAWN_MUTTER will affect spawning
mutter during test in following way:
if it's set to "none" or "0", then mutter won't be spawned at all
if it's set to "once" or "1", then mutter will run only in one instance
for all testcases in test (normally is one mutter instance
spawned for each test case MUTTER_TEST or MUTTER_FAIL_TEST)
tests: add weston tests helper

Add pre-defined functions for tests from weston
tests: make weston-test-helper work with mutter

Mutter windows are created via xdg_shell. Bind to xdg_shell and
create xdg_surface in client_create() function. Also remove dependency
on weston files.
weston-test-helpers: change coding style

We agreen on fully adopting this file, therefore change coding style.
weston-test-helpers: use glib functions

Continue adopting. Replace standard functions with their glib alternatives
(free -> g_free, strcmp ->g_strcmp, xzalloc -> g_new0, ...)
tests: add mutter-test.xml protocol

This protocol contains requests end events specific for mutter tests
test-plugin: add weston-compatible mode

create mutter_test global, but only when the plugin is in
weston-compatible mode. Also handle requests differently when
the plugin is to be compatible with weston.
test helpers: catch mutter_test events

Catch these events and set flags accordingly. The flags are not reseted
by default so user (when he wants check the state) must take care of
reseting the flag before using it
test helpers: add wrapper functions for wl_test requests

add:
  move_pointer ()
  send_button ()
  send_key ()

Each of these functions send the requests and waits for
answer from mutter that the request has been processed
(when not in weston-compatible mode. In that case they
do roundtrip)
tests: create xdg-shell-client-protocol.h for tests

Client headers have been removed recently, but we need this one in tests
weston-test-helpers: add xdg_shell and xdg_surface handling

handle xdg_* events
tests: add sanity tests

few environment tests
tests: add plugin-test

tests for test plugin
tests: add event-test

This test is taken from weston, just changed to work with mutter
tests: add button-test

This test is taken from weston. Basically, it's the same as in plugin
test send_key_tst, but in order of adding testcases, it's not bad to
have it in another file
tests: add bad-buffer-test

from weston
tests: support for installed-tests

see: https://wiki.gnome.org/GnomeGoals/InstalledTests
test-runner: add timeout

Kill test after 10 second (by default). It can be changed
by environment variable MUTTER_TEST_TIMEOUT=n where n is
timeout in seconds. If n is 0, then timeout is turned off.