spice/server/tests
Eduardo Lima (Etrunko) 495d1612c4 Add support for building with meson/ninja
In a comparison with current autotools build system, meson/ninja
provides a huge improvement in build speed, while keeping the same
functionalities currently available and being considered more user
friendly.

The new system coexists within the same repository with the current one,
so we can do more extensive testing of its functionality before deciding
if the old system can be removed, or for some reason, has to stay for
good.

- Meson: https://mesonbuild.com

  This is the equivalent of autogen/configure step in autotools. It
  generates the files that will be used by ninja to actually build the
  source code.

  The project has received lots of traction recently, with many GNOME
  projects willing to move to this new build system. The following wiki
  page has more details of the status of the many projects being ported:

    https://wiki.gnome.org/Initiatives/GnomeGoals/MesonPorting

  Meson has a python-like syntax, easy to read, and the documentation
  on the project is very complete, with a dedicated page on how to port
  from autotools, explaining how most common use cases can be
  implemented using meson.

    http://mesonbuild.com/Porting-from-autotools.html

  Other important sources of information:

    http://mesonbuild.com/howtox.html
    http://mesonbuild.com/Syntax.html
    http://mesonbuild.com/Reference-manual.html

- Ninja: https://ninja-build.org

  Ninja is the equivalent of make in an autotools setup, which actually
  builds the source code. It has being used by large and complex
  projects such as Google Chrome, Android and LLVM. There is not much to
  say about ninja (other than it is much faster than make) because we
  won't interact directly with it as much, as meson does the middle man
  job here. The reasoning for creating ninja in the first place is
  explained on the following post:

    http://neugierig.org/software/chromium/notes/2011/02/ninja.html

  Also its manual provides more in-depth information about the design
  principles:

    https://ninja-build.org/manual.html

- Basic workflow:

  Meson package is available for most if not all distros, so, taking
  Fedora as an example, we only need to run:

    # dnf -y install meson ninja-build.

  With Meson, building in-tree is not possible at all, so we need to
  pass a directory as argument to meson where we want the build to be
  done. This has the advantage of creating builds with different options
  under the same parent directory, e.g.:

    $ meson ./build --prefix=/usr
    $ meson ./build-extra -Dextra-checks=true -Dalignment-checks=true

  After configuration is done, we call ninja to actually do the build.

    $ ninja -C ./build
    $ ninja -C ./build install

  Ninja defaults to parallel builds, and this can be changed with the -j
  flag.

    $ ninja -j 10 -C ./build

- Hacking:

  * meson.build: Mandatory for the project root and usually found under
                 each directory you want something to be built.

  * meson_options.txt: Options that can interfere with the result of the
                       build.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-08-30 11:10:45 -03:00
..
pki tests/pki: Use CA/certificate valid until 2048 2017-03-23 12:02:47 +01:00
valgrind ci: Add some needed Valgrind suppression rule 2018-06-05 15:25:13 +01:00
.gitignore tests: add test-listen executable to gitignore 2018-04-19 07:57:04 +01:00
base_test.ppm Adding image to be used as "correct" in regression tests 2012-02-14 14:53:47 +02:00
basic-event-loop.c tests: basic-event-loop: Silence debug message 2018-03-13 11:40:50 +01:00
basic-event-loop.h tests: Allow to quit the message loop 2017-09-07 08:54:18 +01:00
Makefile.am Add support for building with meson/ninja 2018-08-30 11:10:45 -03:00
meson.build Add support for building with meson/ninja 2018-08-30 11:10:45 -03:00
README tests: Update README 2017-09-07 08:54:18 +01:00
regression-test.py tests: Normalize test names 2016-11-25 13:52:39 +00:00
replay.c tests: Add G_PID_FORMAT to glib compat header 2018-07-08 16:24:35 +01:00
stat-test.c Use verify instead of G_STATIC_ASSERT 2017-12-01 22:49:46 +00:00
test-agent-msg-filter.c test-agent-msg-filter: Adjust for recent logging changes 2018-06-28 14:31:22 +01:00
test-channel.c channel: Remove unused 3rd red_channel_register_client_cbs() arg 2018-06-21 17:54:27 +01:00
test-codecs-parsing.c reds: Fix one case parsing invalid codec string 2018-07-03 09:32:20 +01:00
test-display-base.c Avoid some alignment warnings using clang 2018-01-31 13:35:46 +00:00
test-display-base.h tests: Automatically determine free port to use 2017-09-21 17:32:23 +02:00
test-display-no-ssl.c tests: destroy test object 2017-09-02 08:07:38 +01:00
test-display-resolution-changes.c clang: remove double promotion 2018-01-08 10:20:30 +00:00
test-display-streaming.c Avoid some alignment warnings using clang 2018-01-31 13:35:46 +00:00
test-display-width-stride.c tests: Use GLib memory functions 2017-12-01 22:31:52 +00:00
test-empty-success.c tests: Make test-empty-success automated 2017-09-07 08:54:18 +01:00
test-fail-on-null-core-interface.c tests: Make test-fail-on-null-core-interface an automated test 2017-09-07 08:54:18 +01:00
test-glib-compat.c Fix minor incompatibilities with RHEL6 2017-03-30 10:50:09 +01:00
test-glib-compat.h tests: Add G_PID_FORMAT to glib compat header 2018-07-08 16:24:35 +01:00
test-gst.c Avoid some alignment warnings using clang 2018-01-31 13:35:46 +00:00
test-leaks.c inputs-channels: Remove leak using tablet device 2017-11-22 16:44:09 +00:00
test-listen.c test-listen: Increase failure timeout 2018-03-14 10:17:34 +00:00
test-loop.c tests: Normalize test names 2016-11-25 13:52:39 +00:00
test-multiple.py tests: Normalize test names 2016-11-25 13:52:39 +00:00
test-options.c tests: Move some specific GLib compatibility to compatibility file 2017-03-03 16:49:41 +00:00
test-playback.c tests: Make variables static where possible 2017-09-02 08:02:36 +01:00
test-qxl-parsing.c tests: Use GLib memory functions 2017-12-01 22:31:52 +00:00
test-sasl.c tests: Avoid some possible not initialized warning from Clang 2018-01-31 13:31:40 +00:00
test-stat-file.c tests: Use GLib memory functions 2017-12-01 22:31:52 +00:00
test-stat.c tests: Rename stat-main.c to test-stat.c 2017-09-18 13:50:26 +01:00
test-stream-device.c test-stream-device: Expect the g_log warning about invalid message 2018-08-09 11:28:29 +01:00
test-stream.c test-stream: initialize msg.msg_flags 2017-12-11 10:16:11 +00:00
test-two-servers.c tests: Automatically determine free port to use 2017-09-21 17:32:23 +02:00
test-vdagent.c test-vdagent: Remove useless MIN definition 2017-12-05 10:54:09 +00:00
video-encoders test: Add vp9 support to GStreamer test 2017-04-07 16:45:54 +01:00

What is here
============

This directory will contain a testsuite for the server.

You can run all the tests and use libtool to debug any of them:

libtool --mode=execute gdb test-just-sockets-no-ssl

Overview of tests
=================

test-just-sockets-no-ssl
 A complete server, only provides the main and inputs channels. Doesn't actually produce anything on the channels. Essentially a test of the regular link code (reds.c), good for multiple connect/disconnect tests.

test-empty-success
 tests calling

test-fail-on-null-core-interface
 should abort when run (when spice tries to watch_add)

basic-event-loop.c
 event loop to provide core interface.

Automated tests
===============

test-display-streaming.c
 this test can be used to check regressions. For this, test-display-streaming needs to be called passing --automated-tests as parameter