[PATCH weston 1/4] tests: write logs to files

Kristian Høgsberg hoegsberg at gmail.com
Wed Dec 12 07:58:31 PST 2012


On Wed, Dec 12, 2012 at 02:44:52PM +0200, Pekka Paalanen wrote:
> On Wed, 12 Dec 2012 14:26:38 +0200
> Pekka Paalanen <ppaalanen at gmail.com> wrote:
> 
> > This cleans up the 'make check' output considerably. When all goes well,
> > you will only see the "PASS" line for each of $TESTS.
> > 
> > Weston logs into a separate file than stdout and stderr, so server logs
> > end up in one file per test, and other output to another file per test.
> > 
> > 'make distclean' does not remove the tests/logs/ directory.
> > 
> > Also changes the weston-tests-env interpreter to bash, since I think &>
> > and ${1/.la/.so} might be bashisms.
> > ---
> >  tests/.gitignore       |    1 +
> >  tests/weston-tests-env |   18 +++++++++++++++---
> >  2 files changed, 16 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tests/.gitignore b/tests/.gitignore
> > index 4c6b430..166a6d4 100644
> > --- a/tests/.gitignore
> > +++ b/tests/.gitignore
> > @@ -1,3 +1,4 @@
> > +logs
> >  matrix-test
> >  setbacklight
> >  test-client
> > diff --git a/tests/weston-tests-env b/tests/weston-tests-env
> > index 1f8281f..9a0e632 100755
> > --- a/tests/weston-tests-env
> > +++ b/tests/weston-tests-env
> > @@ -1,12 +1,24 @@
> > -#!/bin/sh
> > +#!/bin/bash
> >  
> >  WESTON=$abs_builddir/../src/weston
> > +LOGDIR=$abs_builddir/logs
> > +
> > +mkdir -p "$LOGDIR"
> > +
> > +SERVERLOG="$LOGDIR/$1-serverlog.txt"
> > +OUTLOG="$LOGDIR/$1-log.txt"
> > +
> > +rm -f "$SERVERLOG"
> >  
> >  case $1 in
> >  	*.la|*.so)
> > -		$WESTON --modules=$abs_builddir/.libs/${1/.la/.so}
> > +		$WESTON --modules=$abs_builddir/.libs/${1/.la/.so} \
> > +			--log="$SERVERLOG" \
> > +			&> "$OUTLOG"
> >  		;;
> >  	*)
> >  		WESTON_TEST_CLIENT_PATH=$abs_builddir/$1 $WESTON \
> > -			--modules=$abs_builddir/.libs/weston-test.so
> > +			--log="$SERVERLOG" \
> > +			--modules=$abs_builddir/.libs/weston-test.so \
> > +			&> "$OUTLOG"
> >  esac
> 
> Or at least something to this effect would be nice, so that one could
> easily see what failed, and concentrate on it. Also, to not overflow
> the terminal backlog, and miss test build warnings.

Yeah, that fine, we can always tweak it as we go.  All four patches
committed.  What about cleaning up the logs on make clean?

> Have you noticed, that surface-global-test.la and surface-test.la
> produce:
> failed to initialize display
> failed to create display: Broken pipe
> 
> Maybe it's a race, where weston-desktop-shell has not started yet, when
> the server is already done and gone? I guess it's not harmful, just
> annoying.

I did see those go by, yes... I think it's because we run the test
inside weston and shut down before desktop-shell gets to connect.
Which reminds me, the test suite can run without any shell module,
which makes a lot of sense in any case.  You have to set

modules=

in weston.ini to make that work.

> Btw. a nice trick to see more details about a single particular test is
> for instance:
> 
> $ WAYLAND_DEBUG=server make check TESTS=button-test
>
> So you see the protocol from the server's perspective, interleaved with
> test output. Or from client's perspective. This was already there. :-)

Yup, I used that with WAYLAND_DEBUG=client when I was porting the
text-test, very useful.

Kristian


More information about the wayland-devel mailing list