[Spice-devel] [PATCH spice-server] tests: Normalize test names

Pavel Grunt pgrunt at redhat.com
Fri Nov 25 13:09:25 UTC 2016


On Fri, 2016-11-25 at 07:49 -0500, Frediano Ziglio wrote:
> > 
> > On Thu, 2016-11-24 at 16:42 +0000, Frediano Ziglio wrote:
> > > Use dash instead of underscores for file names. This is coherent
> > > with rest of file names.
> > 
> > This should apply also to regression_test.py and test_multiple.py
> > 
> 
> I'll do.
> 
> > > Rename all tests to test-XXX and remove the spice- prefix when
> > > present. This is coherent with most of the tests.
> > 
> > For me the spice prefix mean that a spice public interface is
> > used,
> > but ok.
> > 
> > IMO test prefix is unnecessary - it is obvious from the directory
> > that
> > these files are tests. spice-gtk uses that style.
> > 
> 
> Is is true. On the other side is good to distinguish main source of
> a test program and other sources (like utilities) and it's also
> good to be able to specify just the test name instead all sources
> if your test is a single C file. Also mostly tests had "test" in
> their
> name. For these reason I left the "test" in the names.
> 
OK

> > Pavel
> 
> Frediano
> 
> > > 
> > > Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> > > ---
> > >  cfg.mk                                             |  2 +-
> > >  server/tests/Makefile.am                           | 78
> > > +++++++++++-----------
> > >  .../{basic_event_loop.c => basic-event-loop.c}     |  2 +-
> > >  .../{basic_event_loop.h => basic-event-loop.h}     |  0
> > >  server/tests/replay.c                              |  2 +-
> > >  ...codecs-parsing-test.c => test-codecs-parsing.c} |  0
> > >  .../{test_display_base.c => test-display-base.c}   |  2 +-
> > >  .../{test_display_base.h => test-display-base.h}   |  2 +-
> > >  ...test_display_no_ssl.c => test-display-no-ssl.c} |  2 +-
> > >  ...changes.c => test-display-resolution-changes.c} |  2 +-
> > >  ...isplay_streaming.c => test-display-streaming.c} |  2 +-
> > >  ..._width_stride.c => test-display-width-stride.c} |  2 +-
> > >  .../{test_empty_success.c => test-empty-success.c} |  0
> > >  ...erface.c => test-fail-on-null-core-interface.c} |  0
> > >  ...sockets_no_ssl.c => test-just-sockets-no-ssl.c} |  2 +-
> > >  server/tests/test-loop.c                           |  2 +-
> > >  .../tests/{spice-options-test.c => test-options.c} |  2 +-
> > >  server/tests/{test_playback.c => test-playback.c}  |  2 +-
> > >  .../tests/{stat-file-test.c => test-stat-file.c}   |  0
> > >  server/tests/{stream-test.c => test-stream.c}      |  2 +-
> > >  .../{test_two_servers.c => test-two-servers.c}     |  2 +-
> > >  server/tests/{test_vdagent.c => test-vdagent.c}    |  2 +-
> > >  22 files changed, 55 insertions(+), 55 deletions(-)
> > >  rename server/tests/{basic_event_loop.c => basic-event-loop.c}
> > > (99%)
> > >  rename server/tests/{basic_event_loop.h => basic-event-loop.h}
> > > (100%)
> > >  rename server/tests/{spice-codecs-parsing-test.c => test-
> > > codecs-
> > > parsing.c} (100%)
> > >  rename server/tests/{test_display_base.c => test-display-
> > > base.c}
> > > (99%)
> > >  rename server/tests/{test_display_base.h => test-display-
> > > base.h}
> > > (99%)
> > >  rename server/tests/{test_display_no_ssl.c => test-display-no-
> > > ssl.c} (98%)
> > >  rename server/tests/{test_display_resolution_changes.c => test-
> > > display-resolution-changes.c} (98%)
> > >  rename server/tests/{test_display_streaming.c => test-display-
> > > streaming.c} (99%)
> > >  rename server/tests/{test_display_width_stride.c => test-
> > > display-
> > > width-stride.c} (99%)
> > >  rename server/tests/{test_empty_success.c => test-empty-
> > > success.c}
> > > (100%)
> > >  rename server/tests/{test_fail_on_null_core_interface.c =>
> > > test-
> > > fail-on-null-core-interface.c} (100%)
> > >  rename server/tests/{test_just_sockets_no_ssl.c => test-just-
> > > sockets-no-ssl.c} (97%)
> > >  rename server/tests/{spice-options-test.c => test-options.c}
> > > (98%)
> > >  rename server/tests/{test_playback.c => test-playback.c} (99%)
> > >  rename server/tests/{stat-file-test.c => test-stat-file.c}
> > > (100%)
> > >  rename server/tests/{stream-test.c => test-stream.c} (99%)
> > >  rename server/tests/{test_two_servers.c => test-two-servers.c}
> > > (98%)
> > >  rename server/tests/{test_vdagent.c => test-vdagent.c} (98%)
> > > 
> > > diff --git a/cfg.mk b/cfg.mk
> > > index 3e5d345..4068309 100644
> > > --- a/cfg.mk
> > > +++ b/cfg.mk
> > > @@ -142,7 +142,7 @@ exclude_file_name_regexp
> > > --sc_prohibit_have_config_h = ^*/.*(c|cpp|h)
> > >  
> > >  exclude_file_name_regexp--sc_unmarked_diagnostics =
> > > ^.*\.(c|py|h)
> > >  
> > > -exclude_file_name_regexp--sc_prohibit_path_max_allocation =
> > > server/tests/test_display_base.c
> > > +exclude_file_name_regexp--sc_prohibit_path_max_allocation =
> > > server/tests/test-display-base.c
> > >  
> > >  exclude_file_name_regexp--sc_cast_of_argument_to_free =
> > > server/red-
> > > replay-qxl.c
> > >  
> > > diff --git a/server/tests/Makefile.am b/server/tests/Makefile.am
> > > index 626cd81..c55d21d 100644
> > > --- a/server/tests/Makefile.am
> > > +++ b/server/tests/Makefile.am
> > > @@ -21,10 +21,10 @@ endif
> > >  noinst_LIBRARIES = libtest.a
> > >  
> > >  libtest_a_SOURCES =				\
> > > -	basic_event_loop.c			\
> > > -	basic_event_loop.h			\
> > > -	test_display_base.c			\
> > > -	test_display_base.h			\
> > > +	basic-event-loop.c			\
> > > +	basic-event-loop.h			\
> > > +	test-display-base.c			\
> > > +	test-display-base.h			\
> > >  	$(NULL)
> > >  
> > >  LDADD =
> > > \
> > > @@ -37,27 +37,27 @@ LDADD =
> > > 		\
> > >  	$(NULL)
> > >  
> > >  check_PROGRAMS =				\
> > > -	spice-codecs-parsing-test		\
> > > -	spice-options-test			\
> > > -	stat_test				\
> > > -	stream-test				\
> > > +	test-codecs-parsing			\
> > > +	test-options				\
> > > +	test-stat				\
> > > +	test-stream				\
> > >  	test-agent-msg-filter			\
> > >  	test-loop				\
> > >  	test-qxl-parsing			\
> > > -	stat-file-test				\
> > > +	test-stat-file				\
> > >  	$(NULL)
> > >  
> > >  noinst_PROGRAMS =				\
> > > -	test_display_no_ssl			\
> > > -	test_display_streaming			\
> > > -	test_empty_success			\
> > > -	test_fail_on_null_core_interface	\
> > > -	test_just_sockets_no_ssl		\
> > > -	test_playback				\
> > > -	test_display_resolution_changes		\
> > > -	test_two_servers			\
> > > -	test_vdagent				\
> > > -	test_display_width_stride		\
> > > +	test-display-no-ssl			\
> > > +	test-display-streaming			\
> > > +	test-empty-success			\
> > > +	test-fail-on-null-core-interface	\
> > > +	test-just-sockets-no-ssl		\
> > > +	test-playback				\
> > > +	test-display-resolution-changes		\
> > > +	test-two-servers			\
> > > +	test-vdagent				\
> > > +	test-display-width-stride		\
> > >  	spice-server-replay			\
> > >  	$(check_PROGRAMS)			\
> > >  	$(NULL)
> > > @@ -66,16 +66,16 @@ TESTS = $(check_PROGRAMS)
> > > \
> > >  	$(NULL)
> > >  
> > >  noinst_LIBRARIES += \
> > > -	libstat_test1.a \
> > > -	libstat_test2.a \
> > > -	libstat_test3.a \
> > > -	libstat_test4.a \
> > > +	libtest-stat1.a \
> > > +	libtest-stat2.a \
> > > +	libtest-stat3.a \
> > > +	libtest-stat4.a \
> > >  	$(NULL)
> > >  
> > >  spice_server_replay_SOURCES = replay.c		\
> > >  	../event-loop.c				\
> > > -	basic_event_loop.c			\
> > > -	basic_event_loop.h
> > > +	basic-event-loop.c			\
> > > +	basic-event-loop.h
> > >  
> > >  spice_server_replay_LDADD =
> > > \
> > >  	$(top_builddir)/spice-common/common/libspice-common.la
> > > \
> > > @@ -85,25 +85,25 @@ spice_server_replay_LDADD =
> > > 		\
> > >  	$(SPICE_NONPKGCONFIG_LIBS)		             
> > >    \
> > >  	$(NULL)
> > >  
> > > -stat_test_SOURCES = stat-main.c
> > > -stat_test_LDADD = \
> > > -	libstat_test1.a \
> > > -	libstat_test2.a \
> > > -	libstat_test3.a \
> > > -	libstat_test4.a \
> > > +test_stat_SOURCES = stat-main.c
> > > +test_stat_LDADD = \
> > > +	libtest-stat1.a \
> > > +	libtest-stat2.a \
> > > +	libtest-stat3.a \
> > > +	libtest-stat4.a \
> > >  	$(LDADD) \
> > >  	$(NULL)
> > >  
> > > -libstat_test1_a_SOURCES = stat-test.c
> > > -libstat_test1_a_CPPFLAGS = $(AM_CPPFLAGS)
> > > -DTEST_COMPRESS_STAT=0
> > > -DTEST_RED_WORKER_STAT=0 -DTEST_NAME=stat_test1
> > > +libtest_stat1_a_SOURCES = stat-test.c
> > > +libtest_stat1_a_CPPFLAGS = $(AM_CPPFLAGS)
> > > -DTEST_COMPRESS_STAT=0
> > > -DTEST_RED_WORKER_STAT=0 -DTEST_NAME=stat_test1
> > >  
> > > -libstat_test2_a_SOURCES = stat-test.c
> > > -libstat_test2_a_CPPFLAGS = $(AM_CPPFLAGS)
> > > -DTEST_COMPRESS_STAT=0
> > > -DTEST_RED_WORKER_STAT=1 -DTEST_NAME=stat_test2
> > > +libtest_stat2_a_SOURCES = stat-test.c
> > > +libtest_stat2_a_CPPFLAGS = $(AM_CPPFLAGS)
> > > -DTEST_COMPRESS_STAT=0
> > > -DTEST_RED_WORKER_STAT=1 -DTEST_NAME=stat_test2
> > >  
> > > -libstat_test3_a_SOURCES = stat-test.c
> > > -libstat_test3_a_CPPFLAGS = $(AM_CPPFLAGS)
> > > -DTEST_COMPRESS_STAT=1
> > > -DTEST_RED_WORKER_STAT=0 -DTEST_NAME=stat_test3
> > > +libtest_stat3_a_SOURCES = stat-test.c
> > > +libtest_stat3_a_CPPFLAGS = $(AM_CPPFLAGS)
> > > -DTEST_COMPRESS_STAT=1
> > > -DTEST_RED_WORKER_STAT=0 -DTEST_NAME=stat_test3
> > >  
> > > -libstat_test4_a_SOURCES = stat-test.c
> > > -libstat_test4_a_CPPFLAGS = $(AM_CPPFLAGS)
> > > -DTEST_COMPRESS_STAT=1
> > > -DTEST_RED_WORKER_STAT=1 -DTEST_NAME=stat_test4
> > > +libtest_stat4_a_SOURCES = stat-test.c
> > > +libtest_stat4_a_CPPFLAGS = $(AM_CPPFLAGS)
> > > -DTEST_COMPRESS_STAT=1
> > > -DTEST_RED_WORKER_STAT=1 -DTEST_NAME=stat_test4
> > >  
> > >  test_qxl_parsing_LDADD = ../libserver.la $(LDADD)
> > > diff --git a/server/tests/basic_event_loop.c
> > > b/server/tests/basic-
> > > event-loop.c
> > > similarity index 99%
> > > rename from server/tests/basic_event_loop.c
> > > rename to server/tests/basic-event-loop.c
> > > index 2029424..4cc797b 100644
> > > --- a/server/tests/basic_event_loop.c
> > > +++ b/server/tests/basic-event-loop.c
> > > @@ -26,7 +26,7 @@
> > >  #include "spice/macros.h"
> > >  #include <common/ring.h>
> > >  #include <common/mem.h>
> > > -#include "basic_event_loop.h"
> > > +#include "basic-event-loop.h"
> > >  
> > >  int debug = 0;
> > >  
> > > diff --git a/server/tests/basic_event_loop.h
> > > b/server/tests/basic-
> > > event-loop.h
> > > similarity index 100%
> > > rename from server/tests/basic_event_loop.h
> > > rename to server/tests/basic-event-loop.h
> > > diff --git a/server/tests/replay.c b/server/tests/replay.c
> > > index 6c6e01e..f32fa2f 100644
> > > --- a/server/tests/replay.c
> > > +++ b/server/tests/replay.c
> > > @@ -36,7 +36,7 @@
> > >  #include <pthread.h>
> > >  
> > >  #include <spice/macros.h>
> > > -#include "test_display_base.h"
> > > +#include "test-display-base.h"
> > >  #include <common/log.h>
> > >  
> > >  static SpiceCoreInterface *core;
> > > diff --git a/server/tests/spice-codecs-parsing-test.c
> > > b/server/tests/test-codecs-parsing.c
> > > similarity index 100%
> > > rename from server/tests/spice-codecs-parsing-test.c
> > > rename to server/tests/test-codecs-parsing.c
> > > diff --git a/server/tests/test_display_base.c
> > > b/server/tests/test-
> > > display-base.c
> > > similarity index 99%
> > > rename from server/tests/test_display_base.c
> > > rename to server/tests/test-display-base.c
> > > index 8e577c9..31e9226 100644
> > > --- a/server/tests/test_display_base.c
> > > +++ b/server/tests/test-display-base.c
> > > @@ -30,7 +30,7 @@
> > >  #include "spice.h"
> > >  #include <spice/qxl_dev.h>
> > >  
> > > -#include "test_display_base.h"
> > > +#include "test-display-base.h"
> > >  #include "red-channel.h"
> > >  
> > >  #ifndef PATH_MAX
> > > diff --git a/server/tests/test_display_base.h
> > > b/server/tests/test-
> > > display-base.h
> > > similarity index 99%
> > > rename from server/tests/test_display_base.h
> > > rename to server/tests/test-display-base.h
> > > index e5d7965..7b5b509 100644
> > > --- a/server/tests/test_display_base.h
> > > +++ b/server/tests/test-display-base.h
> > > @@ -19,7 +19,7 @@
> > >  #define __TEST_DISPLAY_BASE_H__
> > >  
> > >  #include <spice.h>
> > > -#include "basic_event_loop.h"
> > > +#include "basic-event-loop.h"
> > >  
> > >  #define COUNT(x) ((sizeof(x)/sizeof(x[0])))
> > >  
> > > diff --git a/server/tests/test_display_no_ssl.c
> > > b/server/tests/test-
> > > display-no-ssl.c
> > > similarity index 98%
> > > rename from server/tests/test_display_no_ssl.c
> > > rename to server/tests/test-display-no-ssl.c
> > > index d861128..8b3a09b 100644
> > > --- a/server/tests/test_display_no_ssl.c
> > > +++ b/server/tests/test-display-no-ssl.c
> > > @@ -25,7 +25,7 @@
> > >  
> > >  #include <config.h>
> > >  #include <stdlib.h>
> > > -#include "test_display_base.h"
> > > +#include "test-display-base.h"
> > >  
> > >  SpiceCoreInterface *core;
> > >  SpiceTimer *ping_timer;
> > > diff --git a/server/tests/test_display_resolution_changes.c
> > > b/server/tests/test-display-resolution-changes.c
> > > similarity index 98%
> > > rename from server/tests/test_display_resolution_changes.c
> > > rename to server/tests/test-display-resolution-changes.c
> > > index 069f460..b68a648 100644
> > > --- a/server/tests/test_display_resolution_changes.c
> > > +++ b/server/tests/test-display-resolution-changes.c
> > > @@ -22,7 +22,7 @@
> > >  #include <config.h>
> > >  #include <math.h>
> > >  #include <stdlib.h>
> > > -#include "test_display_base.h"
> > > +#include "test-display-base.h"
> > >  
> > >  SpiceTimer *ping_timer;
> > >  
> > > diff --git a/server/tests/test_display_streaming.c
> > > b/server/tests/test-display-streaming.c
> > > similarity index 99%
> > > rename from server/tests/test_display_streaming.c
> > > rename to server/tests/test-display-streaming.c
> > > index 446bbf3..6e945fd 100644
> > > --- a/server/tests/test_display_streaming.c
> > > +++ b/server/tests/test-display-streaming.c
> > > @@ -32,7 +32,7 @@
> > >  
> > >  #include <glib.h>
> > >  
> > > -#include "test_display_base.h"
> > > +#include "test-display-base.h"
> > >  
> > >  static int sized;
> > >  static int render_last_frame;
> > > diff --git a/server/tests/test_display_width_stride.c
> > > b/server/tests/test-display-width-stride.c
> > > similarity index 99%
> > > rename from server/tests/test_display_width_stride.c
> > > rename to server/tests/test-display-width-stride.c
> > > index bd27e60..dc44282 100644
> > > --- a/server/tests/test_display_width_stride.c
> > > +++ b/server/tests/test-display-width-stride.c
> > > @@ -22,7 +22,7 @@
> > >  #include <config.h>
> > >  #include <math.h>
> > >  #include <stdlib.h>
> > > -#include "test_display_base.h"
> > > +#include "test-display-base.h"
> > >  
> > >  SpiceTimer *ping_timer;
> > >  
> > > diff --git a/server/tests/test_empty_success.c
> > > b/server/tests/test-
> > > empty-success.c
> > > similarity index 100%
> > > rename from server/tests/test_empty_success.c
> > > rename to server/tests/test-empty-success.c
> > > diff --git a/server/tests/test_fail_on_null_core_interface.c
> > > b/server/tests/test-fail-on-null-core-interface.c
> > > similarity index 100%
> > > rename from server/tests/test_fail_on_null_core_interface.c
> > > rename to server/tests/test-fail-on-null-core-interface.c
> > > diff --git a/server/tests/test_just_sockets_no_ssl.c
> > > b/server/tests/test-just-sockets-no-ssl.c
> > > similarity index 97%
> > > rename from server/tests/test_just_sockets_no_ssl.c
> > > rename to server/tests/test-just-sockets-no-ssl.c
> > > index 570903c..98def5a 100644
> > > --- a/server/tests/test_just_sockets_no_ssl.c
> > > +++ b/server/tests/test-just-sockets-no-ssl.c
> > > @@ -18,7 +18,7 @@
> > >  #include <config.h>
> > >  #include <sys/select.h>
> > >  #include <spice.h>
> > > -#include "basic_event_loop.h"
> > > +#include "basic-event-loop.h"
> > >  
> > >  int main(void)
> > >  {
> > > diff --git a/server/tests/test-loop.c b/server/tests/test-loop.c
> > > index c8d3fb1..1e3b39e 100644
> > > --- a/server/tests/test-loop.c
> > > +++ b/server/tests/test-loop.c
> > > @@ -30,7 +30,7 @@
> > >  
> > >  #include <spice/macros.h>
> > >  #include <common/log.h>
> > > -#include "basic_event_loop.h"
> > > +#include "basic-event-loop.h"
> > >  
> > >  static SpiceCoreInterface *core = NULL;
> > >  static GMainLoop *loop = NULL;
> > > diff --git a/server/tests/spice-options-test.c
> > > b/server/tests/test-
> > > options.c
> > > similarity index 98%
> > > rename from server/tests/spice-options-test.c
> > > rename to server/tests/test-options.c
> > > index 72ec215..0cfd4b3 100644
> > > --- a/server/tests/spice-options-test.c
> > > +++ b/server/tests/test-options.c
> > > @@ -19,7 +19,7 @@
> > >  #include <glib.h>
> > >  #include <spice.h>
> > >  
> > > -#include "basic_event_loop.h"
> > > +#include "basic-event-loop.h"
> > >  
> > >  /* GLIB_CHECK_VERSION(2, 40, 0) */
> > >  #ifndef g_assert_nonnull
> > > diff --git a/server/tests/test_playback.c b/server/tests/test-
> > > playback.c
> > > similarity index 99%
> > > rename from server/tests/test_playback.c
> > > rename to server/tests/test-playback.c
> > > index 1283427..7dab278 100644
> > > --- a/server/tests/test_playback.c
> > > +++ b/server/tests/test-playback.c
> > > @@ -22,7 +22,7 @@
> > >  #include <math.h>
> > >  
> > >  #include <spice.h>
> > > -#include "basic_event_loop.h"
> > > +#include "basic-event-loop.h"
> > >  
> > >  /* test the audio playback interface. Really basic no frils
> > > test -
> > > create
> > >   * a single tone sinus sound (easy to hear clicks if it is
> > > generated badly
> > > diff --git a/server/tests/stat-file-test.c b/server/tests/test-
> > > stat-
> > > file.c
> > > similarity index 100%
> > > rename from server/tests/stat-file-test.c
> > > rename to server/tests/test-stat-file.c
> > > diff --git a/server/tests/stream-test.c b/server/tests/test-
> > > stream.c
> > > similarity index 99%
> > > rename from server/tests/stream-test.c
> > > rename to server/tests/test-stream.c
> > > index 8a34a0d..8f653b2 100644
> > > --- a/server/tests/stream-test.c
> > > +++ b/server/tests/test-stream.c
> > > @@ -26,7 +26,7 @@
> > >  
> > >  #include <common/log.h>
> > >  #include "reds-stream.h"
> > > -#include "basic_event_loop.h"
> > > +#include "basic-event-loop.h"
> > >  
> > >  static SpiceServer *server = NULL;
> > >  
> > > diff --git a/server/tests/test_two_servers.c
> > > b/server/tests/test-
> > > two-servers.c
> > > similarity index 98%
> > > rename from server/tests/test_two_servers.c
> > > rename to server/tests/test-two-servers.c
> > > index e89909c..4cf451a 100644
> > > --- a/server/tests/test_two_servers.c
> > > +++ b/server/tests/test-two-servers.c
> > > @@ -21,7 +21,7 @@
> > >  
> > >  #include <config.h>
> > >  #include <stdlib.h>
> > > -#include "test_display_base.h"
> > > +#include "test-display-base.h"
> > >  
> > >  SpiceCoreInterface *core;
> > >  
> > > diff --git a/server/tests/test_vdagent.c b/server/tests/test-
> > > vdagent.c
> > > similarity index 98%
> > > rename from server/tests/test_vdagent.c
> > > rename to server/tests/test-vdagent.c
> > > index bba3e64..a3fa345 100644
> > > --- a/server/tests/test_vdagent.c
> > > +++ b/server/tests/test-vdagent.c
> > > @@ -26,7 +26,7 @@
> > >  
> > >  #include <spice/vd_agent.h>
> > >  
> > > -#include "test_display_base.h"
> > > +#include "test-display-base.h"
> > >  
> > >  SpiceCoreInterface *core;
> > >  SpiceTimer *ping_timer;


More information about the Spice-devel mailing list