Commit Graph

448 Commits

Author SHA1 Message Date
Christophe Fergeau
c8f8ea2224 test: Add test_destroy()
This allows to chain several test cases by using
test_new()/test_destroy().

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-03-01 18:00:27 +01:00
Frediano Ziglio
f66b7bffc7 tests: Add basic spice_server_init()/spice_server_destroy()
This can be used for very basic leak checks.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-03-01 16:06:57 +00:00
Christophe Fergeau
f5494cfa9b test-playback: Pass proper types to spice_server_add_interface
This is a revert of b76e561d.
For a SpicePlaybackInstance, the base interface must be a
SpicePlaybackInterface instance, not a SpiceBaseInterface instance, or
spice-server code will end up reading out of bounds.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-02-15 12:13:55 +01:00
Christophe Fergeau
1afa86c3ee test-display-base: Pass proper types to spice_server_add_interface
This is a revert of 93b4f4050^ and 93b4f4050.
For a SpiceCharDeviceInstance, the base interface must be a
SpiceCharDeviceInterface instance, not a SpiceBaseInterface instance, or
spice-server code will end up reading out of bounds.

vmc_state/vmc_write/vmc_read implementations also have to be provided.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-02-15 12:13:55 +01:00
Christophe Fergeau
14b2f053ab test-vdagent: Pass proper types to spice_server_add_interface
This is a revert of 93b4f4050^ and 93b4f4050.
For a SpiceCharDeviceInstance, the base interface must be a
SpiceCharDeviceInterface instance, not a SpiceBaseInterface instance, or
spice-server code will end up reading out of bounds.

vmc_state/vmc_write/vmc_read implementations also have to be provided.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-02-15 12:13:55 +01:00
Frediano Ziglio
a44a735cda replay: Support TLS in replay utility
Allows to test encrypted connections.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-02-06 10:06:09 +00:00
Snir Sheriber
1004748c46 autotools: compile gst-test only if gstreamer is available
Needed in order to avoid compilation error when gstreamer is
unavailable
2017-02-03 09:08:55 +01:00
Jeremy White
35177a6c41 Avoid a 'missing braces around initializer' warning.
Static variables don't need initializers to be 0.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-01-25 15:41:04 +00:00
Frediano Ziglio
19a900f396 tests: Make possible to have a report of the video encoding
This allows to do some possible statistics or graph.
Currently the report contains encoded sizes.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-01-21 09:05:42 +00:00
Frediano Ziglio
345d7bde23 Compatibility for GStreamer 0.10 for test utility
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2017-01-21 09:04:50 +00:00
Frediano Ziglio
623e7d4a93 Add an helper to test VideoEncoder
Add an utility to make possible to check various features of
VideoEncoder.
2 GStreamer plugins are used in a chain like this:
  (1) input pipeline -> (2) video encoder -> (3) output pipeline
While converting output from (1) is compared with output of (3)
making sure the streaming is working correctly.
You can set various options:
- part of the input pipeline description to allow specifying different
  video from GStreamer test ones to a video file;
- the encoder to use;
- different image properties to use for (2) input:
  - different bit depth;
  - top/down or down/up;
- initial bitrate.

The idea is to use this helper in combination with a shell script
and some video sources to make able to test various settings.
Also can be used to extend the current encoder list.

As an example you can use a command like

$ ./test-gst -e gstreamer:vp8 -i \
  'filesrc location=bbb_sunflower_1080p_30fps_normal.mp4 \
  ! decodebin ! videoconvert'

to check vp8 encoding.

Currently it does not emulate bandwidth changes as stream reports
from the client are not coded.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-01-10 13:42:25 +00:00
Snir Sheriber
af390d53ca tests: Fix compilation error
Fix compilation error due to -Werror=maybe-uninitialized:

  CC       test-display-base.o
test-display-base.c: In function 'do_wakeup':
test-display-base.c:579:13: error: 'update' may be used uninitialized...
             push_command(&update->ext);

Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-01-04 16:09:50 +00:00
Victor Toso
aebc51f91a reds: don't replace video_codecs on failure
We should replace the video_codecs GArray only after the parsing of
input is done, otherwise we might lose previous configuration.

Tests were updated to match this situation. Input that fails to
replace video_codecs are considered bad.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-12-15 11:13:36 +00:00
Victor Toso
8faf7a6f45 Fix gitignore
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-12-08 15:18:25 +01:00
Frediano Ziglio
030ae7bbdc tests: Apply same warning level as main server code
Allow to catch minor issue with test code.
Although test usually are coded with less care than production
code the current changes required are not so extensive and
can catch different issues.
Most of the patch is making functions static to avoid warnings for
undeclared functions.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-12-06 16:16:19 +00:00
Frediano Ziglio
97f631471b build: Remove not existing include directory
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-12-06 13:07:27 +00:00
Frediano Ziglio
4f301ea0e4 Free replay queues
There could be still some data pending.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-12-05 23:27:35 +00:00
Frediano Ziglio
0c8b059fac replay: Free spice server to detect leaks
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-12-05 23:27:35 +00:00
Pavel Grunt
b53c0d368b test: Ignore too new warnings
There is an explicit check for the version

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-12-05 12:32:28 +00:00
Frediano Ziglio
47f56a72e0 Free statistic file on spice_server_destroy
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-11-30 12:36:47 +00:00
Frediano Ziglio
f275733de3 Add a red_memslot_info_destroy function
Allows to free RedMemSlotInfo structure

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-11-25 14:36:40 +00:00
Frediano Ziglio
e05cf93a01 tests: Normalize test names
Use dash instead of underscores for file names. This is coherent
with rest of file names.
Rename all tests to test-XXX and remove the spice- prefix when
present. This is coherent with most of the tests.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-11-25 13:52:39 +00:00
Pavel Grunt
39b6b65421 Do not crash on NULL codecs
Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-17 11:13:04 +00:00
Pavel Grunt
5c311ea8a1 Add test for codecs parsing
With Glib2.34 test invalid codec strings

Reviewed-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-17 11:12:21 +00:00
Frediano Ziglio
973cbb4df2 Revert "replay: Replicate wakeups properly"
This reverts commit c6881ad1a0.

This patch cause the replay utility run at full speed
to slow down a lot and in some cases getting stuck.
I don't understand the reason and when I tested was working
but as we are going to release would be a pity if this test utility
won't work as useful to get feedback and reports.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-17 11:03:51 +00:00
Frediano Ziglio
002c7c9eeb Make RedStatFile private inside stat-file.c
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-16 16:38:32 +00:00
Frediano Ziglio
5209d33977 Add a base test for statistic file
Create a file and add/remove some nodes.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-16 16:38:24 +00:00
Frediano Ziglio
1b4e8855ea Remove core_public and core_interface_adapter globals usage
Avoid not constant globals.

We started encapsulating all global state into RedsState however
there are still some global variable. This patch remove the
core_public global variable.

To implement this a new SpiceCoreInterface *public_interface
field is added to SpiceCoreInterfaceInternal and the
SpiceCoreInterfaceInternal* argument is passed to callbacks to
understand which external interface to use.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-11-15 16:49:09 +00:00
Frediano Ziglio
5902960d39 Make red-replay-qxl.h a public header
The functions declared in that header are all exported by the
library.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-11-10 06:37:15 +00:00
Frediano Ziglio
c6881ad1a0 replay: Replicate wakeups properly
Instead of waking up the command loop for every command queued,
handle saved wakeups and replicate these.
This better reproduces what happened in the server.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-11-10 06:32:58 +00:00
Pavel Grunt
2051007e05 spice-options-test: Convert to gtest to catch criticals
Fail on glib warnings instead of ignoring them

Signed-off-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-11-07 17:18:45 +00:00
Christophe Fergeau
c7f492b75c syntax-check: Add missing license headers
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-01 12:48:26 +00:00
Christophe Fergeau
c979647a77 syntax-check: Remove unused header includes
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-01 12:48:20 +00:00
Christophe Fergeau
9c21b474c0 syntax-check: Add missing <config.h> includes
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-01 12:47:14 +00:00
Frediano Ziglio
b0d8ba9a6a Allows to use scripts for "make check"
Allow both compiled and non-compiled tests to be used with "make
check". Compiled tests should be added to check_PROGRAMS, and scripts
that do not need to be built should be added to TESTS.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-10-20 08:45:12 +01:00
Pavel Grunt
ddf028569e Test agent message filter processing
Signed-off-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-11 13:49:15 +01:00
Pavel Grunt
dee20d8b43 Add agent message filter test
Test filter initialization and configuration

Signed-off-by: Pavel Grunt <pgrunt@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-11 13:48:54 +01:00
Frediano Ziglio
b74fe03f00 Capitalize option documentation
All other options are documented using initial capital case letter.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-09-22 09:37:18 +01:00
Pavel Grunt
1796160095 tests: Check setting of agent properties
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-09-07 14:18:50 +02:00
Frediano Ziglio
c70b2067a9 Constify event_loop_core
Was used as write variable only for testing.
Avoid usage of not constant globals.
Making globals constants avoid future race condition
usages.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-29 08:08:54 +01:00
Pavel Grunt
ce6113d838 replay: Add an option to change video codec 2016-06-14 17:04:40 +02:00
Frediano Ziglio
2b58c60bb1 replay: Handle cursor commands
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-07 22:43:30 +01:00
Frediano Ziglio
1be06f188e make spice-server-replay use dynamic spice-server library
spice-server-replay is built with the same settings as tests.
Currently the tests links to a convenience spice-server library.
A convenience library is a static library build with object file
for a dynamic library.
This make all tests contain all spice-server library code and not
linking to the spice-server dynamic library (the .so).
It's not a problem for most tests however this make impossible for
spice-server-replay utility to be used with a dynamic spice-server
library (you have to recompile it including the library).
This is a pity as you could for instance compare your system
library behavior with the library you are developing.
Also if we decide to install in a future the utility for testing
we would have lot of code duplication.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-18 14:57:06 +01:00
Frediano Ziglio
fa0c32f120 remove a warning building a test
With my compile switches (which are mostly derived from RedHat spec
file) I'm getting this warning:

stream-test.c: In function 'sock_fd_read':
stream-test.c:66:43: warning: dereferencing type-punned pointer will
break strict-aliasing rules [-Wstrict-aliasing]
             *fd = *((int *) CMSG_DATA(cmsg));
                                           ^

memcpy could decrease performance but as this is a test it's not
an issue.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-05-18 14:52:10 +01:00
Frediano Ziglio
1e4800507b use #include<> style for spice-common header inclusions.
The include directory is specified with the -I which is the directory
used directly by #include<>.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-05-09 12:45:27 +01:00
Uri Lublin
2480eb6979 replay: skip the first N (slow) commands
Note that the commands are executed by spice-server.
The "skip" is only done on the "sleep" part of the
"slow" command-line option.

This is helpful to run quickly through uninsteresting commands
in a beginning of a recorded file and going slowly when
interesting parts appear

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-16 10:09:07 +00:00
Uri Lublin
07cb94d7ab replay: count commands
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-03-16 10:08:48 +00:00
Uri Lublin
d82b8b0789 replay: do not use argv after g_option_context_parse
Apparently, after using g_option_context_parse with G_OPTION_REMAINING
argv is modified and should not be used.
This patch uses "file" instead of "argv" and makes sure
file is freed later.
No free is called upon error - exit takes care of it.
2016-03-03 11:57:44 +00:00
Michal Privoznik
2306c364d2 Update .gitignore files
The first part updates the .gitignore file in the root directory
because the file is obviously generated by automake but poison
our working tree.
The second part updates the .gitignore under server/tests/
directory because since 0db1137d we have a noinst test library
libtest.a. However, like in previous case, git should never track
this file.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-02-25 09:12:51 +00:00
Jonathon Jongsma
1438b7ccf2 Add GObject to build requirements
Preparation for GObject-ifying some internals

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-02-16 11:22:04 +00:00
Jonathon Jongsma
de2572815b Add RedsState reference to RedsStream
Allows us to remove use of global 'reds' variable from reds-stream.c.
Requires changing the RedsStream constructor to accept a RedsState arg.

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2016-02-16 10:45:46 +00:00
Frediano Ziglio
6e43433ec2 tests: add a new case for event loop timers
Check that cancelling a timer the timer callback is not called.

This can happen in latency code (red-channel.c).
In red_channel_client_cancel_ping_timer latency timer is cancelled and
state is set to PING_STATE_NONE however if timer was already active what
happens is that the red_channel_client_ping_timer is called and the line

  spice_assert(rcc->latency_monitor.state == PING_STATE_TIMER);

is triggered causing spice-server to abort.
This happens as GLib loop add all active sources to an array but if the
timer is deactivated before the event is dispatched the event will be
dispatched unless the source is destroyed.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-02-12 17:44:47 +00:00
Marc-Andre Lureau
df7ba60503 tests: link test-qxl-parsing with libserver
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-02-03 17:33:15 +00:00
Frediano Ziglio
77adbb7574 replay: remove a message that could be caused by a race condition
The req_cmd_notification callback is called by spice-server when it
has processed all commands and wants to be notified (by a wakeup) that
new commands have been appended to the command queue.
Replay utility tries to fill the commands when it detects that
spice-server is trying to read commands but there are no more commands.
However, new commands are appended in a separate thread so if the main
red worker loop on spice-server is really tight this request can
happen.
Avoid printing any message on this condition, message will be appended
and loop woken up when replay code can do it.

Signed-by: Frediano Ziglio <figlio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-02-03 16:03:17 +00:00
Marc-Andre Lureau
15c908ef25 tests: make sure that the default rule builds all tests
The default rule being "all", it builds noinst_PROGRAMS but not
check_PROGRAMS. Let's build all the tests by default.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-02-02 11:36:10 +00:00
Frediano Ziglio
1ad571f576 replay: do not wake up loop too much
Send wakeups only when a command is available.
This emulate better what a guest driver should do (append the command
to the ring and then signal).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-01-26 12:46:32 +00:00
Jonathon Jongsma
77ae19c0c6 Replay: report error if we don't read the correct file header
The replay file should start with a header such as
  SPICE_REPLAY 1

Instead of soldiering on if we don't encounter this header, print a
warning and return NULL.  Also exit with a failure if spice_replay_new()
returns a NULL object in main.

Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-01-22 11:03:30 +00:00
Christophe Fergeau
6e407a81df event-loop: Remove template
Since SpiceCoreInterfaceInternal is a private data structure, we can
extend it as we see fit without breaking ABI. In particular, adding a
GMainContext member to it allows us to remove the need for
the event loop template which is currently included in the
basic_event_loop.c test file.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-21 14:19:24 +00:00
Christophe Fergeau
4b923347b7 test-loop: Improve basic_event_loop base_{timer, watch}_add
They call the functions provided by event_loop_core, but with a NULL
SpiceCoreInterfaceInternal parameter. It makes more sense to pass
event_loop_core rather than NULL.
This will allow to pass the GMainContext to be used through
SpiceCoreInterfaceInternal rather than through a template parameter.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-21 14:19:12 +00:00
Frediano Ziglio
a5a0d4a290 tests: test removed triggered timers are not called
This could happen for instance if a given timer remove all clients
which have associated timers.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-01-19 23:57:01 +00:00
Frediano Ziglio
323dc46794 tests: add a test for event loop
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-01-19 23:56:59 +00:00
Frediano Ziglio
f3a7befafe tests: extract code for event loop
This code will be reused for main loop

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-01-19 23:56:33 +00:00
Frediano Ziglio
3686132923 tests: do not use default loop context
Make sure we don't handle event reserved to other loop contexts.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-01-19 23:56:28 +00:00
Frediano Ziglio
28c3585730 tests: remove leaks in test-qxl-parsing
This make happy address sanitizer during make check.
Otherwise memory leak detector can keep in and make tests fails.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-01-19 14:03:43 +00:00
Frediano Ziglio
e433a6634c replay: better documentation for -C and -S options
Document all possible values

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-01-15 15:42:19 +00:00
Frediano Ziglio
d80189b5ed replay: add streaming setting option
Add -S to allow to set a video streaming rule.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-01-15 15:04:52 +00:00
Marc-Andre Lureau
47df90a8ce stream-test: add batch test
Check that two consecutive msgfd are read back from two different reads.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-15 11:04:30 +00:00
Marc-Andre Lureau
0db1137dac build-sys: build a noinst libtest.a to link to
Group the test utility in a library, to avoid repeating the same
sources. In this case, automake already figues out what the source of
the programs to build is.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-15 09:58:54 +00:00
Frediano Ziglio
58c5713aa9 replay: remove command line memory leaks
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-01-15 08:58:12 +00:00
Marc-Andre Lureau
f438bd6ae9 tests: add fdpass stream test
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-14 11:04:49 +00:00
Frediano Ziglio
adc0751950 channel: add a new internal SpiceCoreInterface
Define an internal structure that matches 100% the ABI of the public one.
The structure will be changed by following patches.
See comments in "channel: add interface parameters to
SpiceCoreInterfaceInternal" patch.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-01-11 16:29:53 +00:00
Frediano Ziglio
d3b5d2c97e add some tests for cursors parsing
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-01-08 18:16:47 +00:00
Frediano Ziglio
6ea345b820 add test for QXL parsing functions
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-01-08 18:16:47 +00:00
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
Alon Levy
7d6e813b2c server/tests/test_display_base: add missing set_client_capabilities, fix client_monitors_config signature 2013-05-17 11:06:34 -04:00
Alon Levy
4e7d25a7ac Revert "server: add websockets support via libwebsockets"
This reverts commit 63bb37276e.
2012-11-04 13:48:42 +02:00
Alon Levy
63bb37276e server: add websockets support via libwebsockets
New API: spice_server_set_ws_ports

This adds an optional dependency on libwebsockets. You need to get my
patched 0.0.3 version here:
 git://people.freedesktop.org/~alon/libwebsockets

There is no qemu patches yet, to test change in reds.c the default value
of spice_ws_port to 5959 (for the default of spice-html5).

For testing there is an online client at
 http://spice-space.org/spice-html5/spice.html

Known issues:
 1. The tester (server/tests/test_display_no_ssl) gets into dropping all
  data after a few seconds, I think it's an issue with the implemented
  watches, but haven't figured it out.

 2. libwebsocket's read interface is inverted to what our code expects,
 i.e. there is no libwebsocket_read, so there is an additional copy
 involved (see RedsWebSocket). This can be fixed.

 3. Listening on a separate port. Since the headers are different, we
 could listen on the same port (first three bytes RED/GET). I don't know
 if we want to?

Todos:
 1. SSL not implemented yet. Needs some thought as to how.

 2. Serve spice-html5 when accessed as a http server. Nice to have.
2012-10-25 12:33:02 +02:00
Alon Levy
f0761ef894 server/tests/test_display_base: fix segfault in test 2012-10-25 12:31:39 +02:00
Alon Levy
9e1d165fc0 server/tests: agent mock, client_monitors_config 2012-09-13 14:47:32 +03:00
Alon Levy
f567f6b4cd server/tests/test_display_base: fix update_area abort
Don't do zero area update_areas, server now aborts on those. This tester
is not supposed to test those aborts.
2012-09-03 19:26:44 +03:00
Alon Levy
078742b0ee server: add dist-hook to prevent spice version configure/spice.h difference 2012-09-03 10:31:02 +03:00
Alon Levy
a6b2c10c1e add server/tests/test_vdagent 2012-09-02 14:42:18 +03:00
Alon Levy
12c4349de7 server/tests/test_two_servers 2012-09-02 13:36:49 +03:00
Alon Levy
caea769943 server/tests: introduce Test struct 2012-09-02 13:36:41 +03:00
Marc-André Lureau
4e7f071e6f tests: add missing file to .gitignore
TODO: some day, switch to git.mk
2012-07-16 17:36:52 +02:00
Yonit Halperin
dd0d4959bb server/tests: test_display_streaming - test wide sized frames
Before, we tested only higher frames, while wider frames would have
triggered a bug in mjpeg_encoder, when spice is linked with libjpeg and
not libjpeg-turbo.
2012-05-16 08:55:11 +03:00
Yonit Halperin
4c88034845 server/tests/test_display_streaming: include tests for clip and sized frames
CC: Alon Levy <alevy@redhat.com>
2012-05-03 13:09:54 +03:00
Yonit Halperin
c44726bd5f server/tests: use the correct dimensions in SIMPLE_UPDATE 2012-05-03 13:09:54 +03:00
Yonit Halperin
a267a4b315 server/tests: add SLEEP command to test_display_base 2012-05-03 13:09:53 +03:00
Yonit Halperin
bccf5bc35a server/tests: add clip to SIMPLE_DRAW_BITMAP 2012-05-03 13:09:53 +03:00
Alon Levy
3373cda434 server/tests/test_display_streaming: update to create sized frames 2012-05-03 13:09:52 +03:00
Alon Levy
8778b8eb2c server/tests: add SIMPLE_DRAW_SOLID and SIMPLE_DRAW_BITMAP 2012-05-03 13:09:51 +03:00
Alon Levy
76fd64ad96 server/tests: refactor Command 2012-05-03 13:09:51 +03:00
Alon Levy
703f32cda9 server/tests: add test_get_width/test_get_height 2012-05-03 13:09:50 +03:00
Alon Levy
2f02599e6a server/tests: refactor test_display_base 2012-05-03 13:09:50 +03:00
Daniel P. Berrange
e71cb83680 Ensure config.h is the first include in the file
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:49:34 +01:00
Daniel P. Berrange
39565707a9 Make some int->pointer casts explicit
Tell the compiler that was really do intend to cast from int
to pointer, to prevent warnings about implicit casts

* server/tests/test_display_base.c: Add explicit casts

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2012-04-25 09:49:25 +01:00
Marc-André Lureau
359fc1cb5d Use the spice-common submodule
This patch will replace the common/ directory with the spice-common
project. It is for now a simple project subdirectory shared with
spice-gtk, but the goal is to make it a proper library later on.

With this change, the spice-server build is broken. The following
commits fix the build, and have been seperated to ease the review.

v2
- moves all the generated marshallers to spice-common library
- don't attempt to fix windows VS build, which should somehow be
  splitted with spice-common (or built from tarball only to avoid
  generation tools/libs deps)
v3
- uses libspice-common-client
- fix a mutex.h inclusion reported by Alon
2012-03-25 18:59:10 +02:00
Alon Levy
a7d3f1de82 server/tests: add resolution changes tester 2012-03-22 11:18:37 +02:00
Alon Levy
a6f9797c79 server/tests/test_display_base: add Command
add parameters to the commands used for display tests.
2012-03-22 11:18:37 +02:00
Alon Levy
c36bf55971 server/tests/test_display_base: remove 64bit arch assumptions 2012-03-21 17:58:25 +02:00
Marc-André Lureau
534b71dfaa build-sys: fix make distcheck
- Do not refer to .c files managed by another makefile (this will fail
  make distclean)
- Do not refer to files by relative path (should use $top_srcdir for ex)
- Use LDADD for object linking instead of LDFLAGS, for linker flags
2012-03-01 16:24:10 +01:00
Marc-André Lureau
22ee470d4e build-sys: cleanup server/tests/Makefile.am 2012-03-01 16:24:10 +01:00
Fabiano Fidêncio
65f89aca2c Enabling cursor in server/tests
Now, cursor is being shown in all tests as a white rectangle and is
    running in the screen doing a diagonal movement. It's a very simple
    way to test cursor commands and is sufficient for our tests.
2012-02-26 13:10:25 +01:00
Alon Levy
7e3fb815cc server/tests/basic_event_loop: print something on channel_event 2012-02-15 15:09:13 +02:00
Dan McGee
3f303d6014 Remove all usages of bzero()
As recommended by modern C practice, we should just be using memset().

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-02-14 18:19:43 +02:00
Alon Levy
e4a92b177a server/tests: use getopt_long 2012-02-14 17:30:50 +02:00
Fabiano Fidêncio
33bd5d2797 Adding image to be used as "correct" in regression tests 2012-02-14 14:53:47 +02:00
Fabiano Fidêncio
1e8e2f9ee0 Adding support to automated tests
As suggested by Alon, a simple automated test to try to find
    regressions in Spice code.
    To use this, compile Spice with --enable-automated-tests and
    run test_display_streaming passing --automated-tests as parameter.
2012-02-14 14:53:44 +02:00
Alon Levy
51d7598a2e server/tests/test_empty_success: fix warning on bzero
Signed-off-by: Alon Levy <alevy@redhat.com>
2012-01-23 12:41:56 +02:00
Dan McGee
b0b19f4b25 Update .gitignore with a few more generated files
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
2012-01-23 12:28:58 +02:00
Daniel P. Berrange
68c2897e5b Remove trailing whitespace from end of lines 2012-01-13 18:11:59 +02:00
Daniel P. Berrange
7427b23d84 Add missing includes of config.h
Not all files were including config.h
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
d46bc77278 Remove bogus include of strings.h
The tests include strings.h but don't need any of its functions
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
02d56750bd Remove trailing blank lines
Remove any blank lines at the end of all source files
2012-01-13 18:11:59 +02:00
Daniel P. Berrange
faf0947ebb Remove useless if() before free()
The free() function allows NULL to be passed in, so any
code which puts a if() before free() is wasting time
2012-01-13 18:11:58 +02:00
Christophe Fergeau
011266555a server: fix function prototypes
Several functions in server/ were not specifying an argument list,
ie they were declared as void foo(); When compiling with
-Wstrict-prototypes, this leads to:
test_playback.c:93:5: erreur: function declaration isn’t a prototype
[-Werror=strict-prototypes]
2011-09-05 07:52:20 +02:00
Christophe Fergeau
a26f5714e4 fix valgrind warning in test_display__stream
create_test_primary_surface::test_display_base.c creates a
QXLDevSurfaceCreate structure and initialize it, but doesn't set
the position field. Moreover, this structure has 4 bytes of padding
to the end (as shown by pahole from dwarves), so initialize the whole
structure to 0 before using it.
2011-09-01 03:57:35 +02:00
Alon Levy
51ac99dbf4 server: add tester and todo for multiple client support 2011-08-23 19:18:23 +03:00
Alon Levy
2bddc6e33c server/tests/test_playback: correctly use spice_server_playback_get_buffer
and spice_server_playback_put_samples. The former retrieves a buffer from a free
list with spice_server_playback_get_buffer, and should be used once via
spice_server_playback_put_samples. The tester previously reused the same buffer
a number of times.
2011-08-23 17:01:14 +03:00
Alon Levy
b88f233633 server/tests/basic_event_loop: multiple fixes
reuse common/ring.h
ignore SIGPIPE
fix handling of removed watches
2011-08-23 17:01:14 +03:00
Alon Levy
5c99a6da4f server/tests/test_display_base: fix compile 2011-08-23 17:01:14 +03:00
Alon Levy
0378df6254 server/tests: test_util.h: fix double ASSERT definition 2011-07-20 11:05:44 +03:00
Alon Levy
86f7b490a9 server/tests/basic_event_loop: strange assert failure; fix 2011-07-05 14:08:30 +02:00
Alon Levy
87486fd790 server/tests: show port to connect to 2011-05-09 09:46:22 +03:00
Marc-André Lureau
138c421193 build: fix gettimeofday warning
CC     test_playback.o
test_playback.c: In function ‘playback_timer_cb’:
test_playback.c:56:5: warning: implicit declaration of function ‘gettimeofday’
2011-05-03 17:16:46 +02:00
Christophe Fergeau
2a4614ea94 autotools: refactor the whole build machinery
spice Makefile.am setup is a bit confusing, with source file
names being listed several times in different Makefile.am
(generally, once in EXTRA_DIST and another time in another
Makefile.am in _SOURCES). The client binaries are built
by client/x11/Makefile.am, which means recursing into client,
then into x11 to finally build spicec. This Makefile.am is
also referencing files from common/ and client/, which is
a bit unusual with autotools.

This patch attempts to simplify the build process to get
something more usual from an autotools point of view.
The source from common/ are compiled into a libtool convenience
library, which the server and the client links against which avoids
referencing source files from common/ when building the server and
the client. The client is built in client/Makefile.am and directly
builds files from x11/ windows/ and gui/ if needed (without
recursing in these subdirectories).

This makes the build simpler to understand, and also makes it
possible to list source files once, which avoids potential
make distcheck breakage when adding new files.

There is a regression in this patch with respect to
sw_canvas/gl_canvas/gdi_canvas. They should be built with
different preprocessor #defines resulting in different behaviour
of the canvas for the client and the server. However, this is not
currently the case, both the client and the server will use the same
code for now (which probably means one of them is broken). This will
be fixed in a subsequent commit.

make distcheck passes, but compilation on windows using the
autotools build system hasn't been tested, which means it's likely
to be broken. It shouldn't be too hard ot fix it though, just let
me know of any issues with this.
2011-05-03 14:44:10 +02:00
Christophe Fergeau
4031681638 server/tests remove useless assignment
This was detected by clang-static-analyzer.
2011-04-08 12:14:20 +02:00
Christophe Fergeau
3ba093a57e tests: fix compilation with -Wall -Werror
When compiling spice with make CFLAGS="-g3 -ggdb3 -O0 -Wall -Werror",
the build broken because of a few unused variables/missing returns.
This patch fixes these warnings.
2011-04-08 12:14:19 +02:00
Christophe Fergeau
5dd6932bf7 remove duplicated macro
MIN() is already defined in spice-protocol/spice/macros.h
2011-04-04 11:59:53 +02:00
Alon Levy
02c3f54deb server/tests: add test_playback 2011-03-22 09:44:52 +02:00
Alon Levy
0f4a0aa07e server/tests/basic_event_loop: fix bzero warning 2011-02-11 19:13:03 +02:00
Alon Levy
293f5f0df8 server/tests: split test_display_no_ssl to test_display_base, add streaming test 2011-01-10 14:11:37 +02:00
Alon Levy
2c16ef8f26 server/tests/test_display_no_ssl: add update_area, COPY_BITS to tested functions, make a queue of QXLCommandExt waiting (cursor still with production at get_command) 2011-01-10 14:11:37 +02:00
Alon Levy
92e4ab6d68 server/tests/test_display_no_ssl: add surface create/destroy test (commented out), and square mode (default) 2011-01-10 14:11:37 +02:00
Alon Levy
2124818788 server/tests: fix timer reset to allow setting next call during callback 2011-01-10 14:11:37 +02:00
Alon Levy
c1846506de server/tests/test_display_no_ssl: change color every circle 2011-01-10 14:11:37 +02:00
Alon Levy
618d13d4d1 server/tests/test_display_no_ssl: restart notify timer 2011-01-10 14:11:37 +02:00
Alon Levy
0707feca43 server/tests: basic_event_loop: reset timer after firing it 2011-01-10 14:11:37 +02:00
Alon Levy
9cdeac5da5 server/tests/test_display_no_ssl: disable cursor test until it works correctly 2011-01-10 14:11:22 +02:00
Alon Levy
4dcacefb06 server/test/test_display_no_ssl: add beginning of basic cursor item test. doesn't actually show anything on client. also, leaks. 2011-01-10 14:10:44 +02:00
Alon Levy
e62f4b6fc7 server/tests/test_display_no_ssl: make window 320x320, two colored updates, one in notify batch 2011-01-10 14:10:38 +02:00
Hans de Goede
926ee7a361 Makefiles: fix server/tests/test_util.h not being included in make dist 2010-12-17 14:14:39 +01:00
Alon Levy
8c6f94a679 server/tests: fix for AM_LDFLAGS introduction 2010-12-08 18:43:23 +02:00
Alon Levy
450278a299 server/tests: Makefile.am: use AM_LDFLAGS instead of LDFLAGS 2010-12-07 21:33:26 +02:00
Alon Levy
9002d3f005 server/tests: add test_display_no_ssl
updates taken from spice vga mode updates, i.e. non cacheable, glz compressed
(depends on whatever settings you apply to the server) opaque draw operations.
 + completed the SpiceCoreInterface implementation (timers)

v1->v2:
 removed test_util.c (Hans)
 replaced mallocz with calloc (Hans)
2010-11-30 21:03:14 +02:00
Alon Levy
74b39efd6e server/tests: Makefile.am fixes
* don't install tests on make install
 * don't forget anything for make dist tarball
2010-11-30 21:01:06 +02:00
Alon Levy
eb79d1e568 add .gitignore for tests 2010-11-30 20:54:49 +02:00
Alon Levy
0ede43e893 server: tests: add basic tests with working do nothing server 2010-11-08 16:04:27 +02:00