[PATCH v1 weston 07/11] tests: Add a fadein test

Bryce Harrington bryce at osg.samsung.com
Mon Nov 24 18:48:51 PST 2014


On Mon, Nov 24, 2014 at 01:19:46PM +0200, Pekka Paalanen wrote:
> On Wed, 19 Nov 2014 15:06:22 -0800
> Bryce Harrington <bryce at osg.samsung.com> wrote:
> 
> > This also serves as a proof of concept of the screen capture
> > functionality and as a demo for snapshot-based rendering verification.
> > 
> > Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
> > ---
> >  Makefile.am         |  7 +++++-
> >  tests/fadein-test.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 70 insertions(+), 1 deletion(-)
> >  create mode 100644 tests/fadein-test.c
> > 
> > diff --git a/Makefile.am b/Makefile.am
> > index 26dd473..c3dfa10 100644
> > --- a/Makefile.am
> > +++ b/Makefile.am
> > @@ -852,7 +852,8 @@ weston_tests =					\
> >  	text.weston				\
> >  	presentation.weston			\
> >  	roles.weston				\
> > -	subsurface.weston
> > +	subsurface.weston			\
> > +	fadein.weston
> >  
> >  
> >  AM_TESTS_ENVIRONMENT = \
> > @@ -954,6 +955,10 @@ subsurface_weston_SOURCES = tests/subsurface-test.c
> >  subsurface_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
> >  subsurface_weston_LDADD = libtest-client.la
> >  
> > +fadein_weston_SOURCES = tests/fadein-test.c
> > +fadein_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
> > +fadein_weston_LDADD = libtest-client.la
> > +
> >  presentation_weston_SOURCES = tests/presentation-test.c
> >  nodist_presentation_weston_SOURCES =		\
> >  	protocol/presentation_timing-protocol.c	\
> > diff --git a/tests/fadein-test.c b/tests/fadein-test.c
> > new file mode 100644
> > index 0000000..a6c284f
> > --- /dev/null
> > +++ b/tests/fadein-test.c
> > @@ -0,0 +1,64 @@
> > +/*
> > + * Copyright © 2014 Samsung
> > + *
> > + * Permission to use, copy, modify, distribute, and sell this software and
> > + * its documentation for any purpose is hereby granted without fee, provided
> > + * that the above copyright notice appear in all copies and that both that
> > + * copyright notice and this permission notice appear in supporting
> > + * documentation, and that the name of the copyright holders not be used in
> > + * advertising or publicity pertaining to distribution of the software
> > + * without specific, written prior permission.  The copyright holders make
> > + * no representations about the suitability of this software for any
> > + * purpose.  It is provided "as is" without express or implied warranty.
> > + *
> > + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
> > + * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
> > + * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
> > + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
> > + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
> > + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
> > + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
> > + */
> > +
> > +#include "config.h"
> > +
> > +#include <unistd.h>
> > +#include <stdio.h>
> > +
> > +#include "weston-test-client-helper.h"
> > +
> > +char *server_parameters="--use-pixman --width=320 --height=240";
> > +
> > +static char*
> > +output_filename(const char* basename) {
> > +	static const char *path = "./";
> > +	char *filename;
> > +
> > +        if (asprintf(&filename, "%s%s", path, basename) < 0)
> > +		filename = NULL;
> > +
> > +	return filename;
> > +}
> > +
> > +TEST(fadein)
> > +{
> > +	struct client *client;
> > +	char basename[32];
> > +	char *out_path;
> > +	int i;
> > +
> > +	client = client_create(100, 100, 100, 100);
> > +	assert(client);
> > +
> > +	for (i = 0; i < 6; i++) {
> > +		snprintf(basename, sizeof basename, "fadein-%02d", i);
> > +		out_path = output_filename(basename);
> > +
> > +		wl_test_record_screenshot(client->test->wl_test, out_path);
> > +		client_roundtrip(client);
> > +		free (out_path);
> > +
> > +		usleep(250000);
> > +	}
> > +
> > +}
> 
> Hi,
> 
> where is the verification promised in the commit message? ;-)
> 
> I think it is bad to rely on delays/timers. We need something
> more deterministic: a protocol to drive the (headless) repaint.
> 
> We probably need the headless repaint to not run on its own, but
> strictly when requested by the test client. Additionally, we probably
> want to carry a "page flip completion" timestamp in that request, and
> have the compositor use the timestamp. That way the test client can
> actually drive the in-compositor animations, because it is in control
> of the clock and framerate.

Yes, that would definitely be helpful.

Can you elaborate on how this should be implemented?

> That should make the fade-in test reliable, and it will help with
> Presentation testing too.
> 
> The client driven repaint likely needs to be enabled per-test. If a
> test attempts to enable it, but the compositor still does not advertise
> the support(!) in protocol, the test should skip. This way real
> hardware backends can skip these tests automatically, as they cannot
> (or not implemented yet) support client driven repaint.
> 
> How would that sound?

Sure, although I suspect all tests that care about the rendered output
will need to set this.  Unless they care only about the initial frame.

> As a first proof of concept screenshooting test, I'd prefer something
> that doesn't depend on timings at all, so we can add the screenshooting
> sooner, and the client driven repaint later if that needs more time.
> Which probably calls for an option to skip the fade-in in Weston... oh
> but we already have 'startup-animation=none' from weston.ini.

Ah, I wondered if there was a switch to disable that, thanks.  Only
reason I did fadein as the test was because I couldn't get around the
timed fade in.  ;-)

Bryce

> Thanks,
> pq
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list