Commit Graph

125 Commits

Author SHA1 Message Date
Eduardo Lima (Etrunko)
8c6dcc5eaf server: Fix tests Makefile
As reported in https://bugs.freedesktop.org/show_bug.cgi?id=93520, the
build from git is failing in Archlinux systems with undefined
references to glib symbols.

This patch fixes the problem by simply reordering the order libraries
will be linked. Also, removes duplicate $(GLIB_LIBS) variable.

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-08 12:23:54 +00:00
Pavel Grunt
952aaca3d7 syntax-check: Remove empty line at EOF
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-01-08 11:24:14 +00:00
Frediano Ziglio
cc5fa8fa9b replay: better help for -s option
-s accepts an option to delay command queueing.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Marc-André Lureau <mlureau@redhat.com>
2015-12-22 16:45:48 +00:00
Marc-Andre Lureau
3364af70a3 tests: remove test_util.h
Replace ASSERT() with spice_assert().

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-12-21 11:44:34 +00:00
Frediano Ziglio
f5f103b8d7 tests: remove unused macro
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-21 10:39:56 +00:00
Frediano Ziglio
b953a4e35f tests: reuse Makefile macro
For coherency use COMMON_BASE macro instead of including single
files.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2015-12-15 17:39:49 +00:00
Frediano Ziglio
276d9f08cd tests: allocate memory in a coherent fashion
Do not free memory allocated with C functions (like calloc) using g_free;
although this is possible with default Glib allocator this is not safe.
Also use consistent allocation functions. All other spice-server code
does not use Glib allocations so for coherence do not use them for
watches.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2015-12-15 17:39:38 +00:00
Frediano Ziglio
c4c716ab18 stat: add test for statistic functions
Make sure code compile with and without statistics enabled (beside
printing functions).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-09 17:02:54 +00:00
Francois Gouget
9b42aafe31 server: Rename SUPPORT_AUTOMATED_TESTS to HAVE_AUTOMATED_TESTS
This improves consistency with spice-deps.m4 which names its
AM_CONDITIONAL() variables HAVE_XXX.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-12-08 15:39:11 +01:00
Alon Levy
aef334e6e8 tests: test_display_base: use a faster wakeup time to easily test multiple client blocking
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-12-04 11:46:27 +00:00
Frediano Ziglio
525cd67be7 server: rename files
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-03 23:54:32 +00:00
Christophe Fergeau
e5e3e9eefe Add missing license headers 2015-10-19 14:25:36 +02:00
Christophe Fergeau
c61a37603a syntax-check: Remove unused #include <strings.h> 2015-10-19 14:25:36 +02:00
Christophe Fergeau
c0b2b1fc49 syntax-check: Add missing #include <config.h> 2015-10-19 14:25:36 +02:00
Jeremy White
df0eab862c Update the .gitignore files for the new manual,
for a few newly generated tests, and for the spice-server.h.
2015-10-16 15:48:23 -05:00
Christophe Fergeau
5eaf659aa3 tests: Fix -Werror=format-zero-length build failure
replay.c: In function 'replay_channel_event':
replay.c:226:16: error: zero-length gnu_printf format string
[-Werror=format-zero-length]
     g_printerr("");
2015-09-29 18:59:54 +01:00
Frediano Ziglio
2a09a5fa36 replay: compatibility with former version
GMutex usage in replay.c was not working so replace with plain pthread.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-09-01 17:17:21 +01:00
Frediano Ziglio
e5063799ab replay: do not define same type twice
Avoid to use typedef twice for the same type as some compiler
complaints about it.
SpiceTimer and SpiceWatch are defined in server/spice-core.h
as an abstract type which should be defined by some code (as
server/tests/basic_event_loop.c does).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-09-01 17:16:50 +01:00
Christophe Fergeau
09394e857f build-sys: Remove test_spice_version.h
This script was used at make distcheck time to verify consistency of the
version number defined in configure.ac and in spice-server headers.
Since commit ab12cf414c, these 2 version numbers can no longer be out of
sync, so we can drop this script.
2015-08-26 11:01:09 +02:00
Alon Levy
622cb433a8 server/tests/spice-server-replay: introduce
usage: spice-server-replay -p <port> -c <client command line> <cmdfile>

will run the commands from cmdfile ignoring timestamps, right after a
connection is established from the client, and will SIGINT the client
on end of cmdfile, and exit itself after waiting for the client.

spicy-stats from spice-gtk is useful for testing, it prints the summary
of the traffic on each channel.

You can also run with no client by doing:
spice-server-replay <cmdfile>

For example, the 300 MB file (compressed to 4 MB with xz -9) available
at [1] produces the following output:

spicy-stats total bytes read:
total bytes read:
inputs: 214
display: 1968983
cursor: 390
main: 256373

You could run it directly like so:
curl http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz | \
  xzcat | server/tests/spice-server-replay -p 12345 -c `which spicy-stats` -

Known Problems:
* Implementation is wrong. Should do a single device->host conversion
 (i.e. get_virt), and then marshall/demarshall that (i.e. RedDrawable).
* segfault on file read done resulting in the above spicy-stats not
 being reproducable (well, up to 1% yes).

[1] http://annarchy.freedesktop.org/~alon/win7_boot_shutdown.cmd.xz

Now based on glib including using an asyncqueue for reading the playback
file, and proper freeing of the allocated commands, with --slow,
--compression and a progress timer, and doesn't use more then nsurfaces.

Signed-off-by: Alon Levy <alon@pobox.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2015-08-22 12:36:37 +01:00
Marc-André Lureau
f3179ef791 tests: use glib main loop 2015-08-20 17:47:24 +01:00
Christophe Fergeau
5acc017638 build-sys: Remove spice-protocol submodule
It's seeing regular releases and is API stable, so we don't need to
bundle it with spice-server
2015-08-20 12:30:55 +01:00
Christophe Fergeau
de66161c6e Adjust to new SpiceImageCompress name
This has been renamed to SpiceImageCompression in order to avoid clashes
with older spice-server in the SPICE_IMAGE_COMPRESS_ namespace. This
commit is a straight rename of SpiceImageCompress to
SpiceImageCompression and SPICE_IMAGE_COMPRESS_ to
SPICE_IMAGE_COMPRESSION_
2015-07-29 17:40:48 +02:00
Jeremy White
04d9d79013 Add libraries such as -lm and -lpthread to the tests build line.
This prevents a compile error on Debian Jessie, from git, such as this:
/usr/bin/ld: test_playback.o: undefined reference to symbol 'sin@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line

This is fairly subtle, and Debian specific.  It only happens when you use
autoreconf to generate a new libtool script.  Debian patches that script
to require an explicit setting to link with all dependent libraries.

It should be harmless on other distros, and it does save us Debian guys some
hassle.
2015-07-28 10:12:46 -05:00
Fabiano Fidêncio
423fbe9fcd tests: Fix build on Hurd
As PATH_MAX is not defined on Hurd, let's check for it and define
whenever it is necessary.

https://bugs.freedesktop.org/show_bug.cgi?id=74313
2015-02-24 15:39:24 +01:00
Marc-André Lureau
6a49d59e7e build-sys: fix out-of-tree build of tests
Fixes the following build error:
In file included from
/home/elmarco/src/spice-new/src/spice/server/tests/test_display_base.h:4:0,
                 from
                 /home/elmarco/src/spice-new/src/spice/server/tests/test_display_no_ssl.c:11:
                 /home/elmarco/src/spice-new/src/spice/server/spice.h:23:27:
                 fatal error: spice-version.h: No such file or directory
                  #include "spice-version.h"
                                             ^
2014-11-29 15:32:44 +01:00
Christophe Fergeau
504d027bb2 server/tests/Makefile.am: White-space cleanup
Make sure the \ at the end of lines are nicely aligned
2014-09-18 14:06:55 +02:00
Fabiano Fidêncio
93b4f4050c Fix -Wunused-function 2014-09-12 18:00:30 +02:00
Fabiano Fidêncio
b76e561d82 Fix -Wmissing-field-initializers 2014-09-12 18:00:30 +02:00
Fabiano Fidêncio
fb938c210a Fix -Wnonnull 2014-09-12 18:00:30 +02:00
Fabiano Fidêncio
63180f6ce3 Fix -Wformat 2014-09-12 18:00:30 +02:00
Fabiano Fidêncio
4bf5fd35c4 Fix -Wswitch 2014-09-12 18:00:30 +02:00
Fabiano Fidêncio
08b3e1d8f1 Fix -Wsign 2014-09-12 18:00:30 +02:00
Fabiano Fidêncio
79e5a52d05 Fix -Wunused-value 2014-09-12 18:00:30 +02:00
Fabiano Fidêncio
5ea7de3bcc Fix -Wunused-parameter 2014-09-12 18:00:30 +02:00
Marc-André Lureau
004744fd2f build-sys: check for spicy-screenshot 2014-09-08 14:49:29 +02:00
Christophe Fergeau
7d9018d441 tests: Avoid malloc failures
test-display-streaming is calling malloc() without checking its return
value. Coverity warns about this. This commit switches to g_malloc() to
sidestep this warning (g_malloc() never returns NULL but aborts instead).
2014-01-02 18:07:16 +01:00
Christophe Fergeau
3ac428b4b7 tests: Remove unused variables
coverity spotted some variables that were declared but not used in
server/tests
2014-01-02 18:06:08 +01:00
Marc-André Lureau
e93b2bb188 server/tests: avoid using deprecated symbols 2013-10-07 16:33:20 +02:00
Marc-André Lureau
ced4f1adfd build-sys: fix some automake warning
client/Makefile.am:199: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
server/tests/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
2013-09-17 19:41:27 +02:00
Uri Lublin
d45f3bdc6b syntax-check: make sure config.h is the first included .h file 2013-07-16 23:37:29 +03:00
Uri Lublin
bc77805b5f syntax-check: fix no-newline or empty line at EOF 2013-07-16 23:37:29 +03:00
Uri Lublin
413883ecf8 syntax-check: fix cast_of_argument_to_free
In this case, make syntax-check is wrong, and we actually do
need the cast.
A cast is needed when types are   uint64_t <--> pointer

Using a local "ptr" variable makes both gcc and syntax-check happy.
2013-07-16 23:37:28 +03:00
Uri Lublin
8511c747d1 server/tests: fix timer for test_empty_success 2013-07-16 23:37:28 +03:00
Uri Lublin
3ede55b2ba server/tests: test_display_width_stride: add destroy command
Otherwise, the test exits after the first iteration over all tests,
on the second attempt to create an already created surface.
2013-07-16 23:37:28 +03:00
Uri Lublin
b66d755447 server/tests: remove option from usage if AUTOMATED_TESTS is not configured 2013-07-16 23:37:27 +03:00
Uri Lublin
cbcd9eea36 server/tests: invalid-option: print the bad argument
optind points to the next argument to parse.
2013-07-16 23:37:27 +03:00
Uri Lublin
694f4b9e57 server/tests: fix produce_command for create surface
Earlier in this function, test->target_surface is set to 1, which
is the only allowed non-primary surface currently.

If surface parameters are given (and specifically data is checked)
they are being used, otherwise a default surface is used.

Earlier in this function, "command" is set to a non-NULL value.
Thus, the else part was unreachable code, which is fixed now.
2013-07-16 23:37:27 +03:00
Uri Lublin
ff03d8dd2a server/tests: test_display_base: set rect according to appropriate surface
When surface_id == 0, primary is used.
Otherwise (currently 1), secondary is used.

Also, remove unused test_width and test_height.
Since commit caea769943,
test->width and test->height are used.
2013-07-16 23:37:27 +03:00
Alon Levy
bcd7c4e097 server/tests: test_display_width_stride 2013-05-17 11:06:34 -04:00