[PATCH weston v2 0/9] Enable test configuration

Bryce Harrington bryce at osg.samsung.com
Tue Apr 7 15:32:51 PDT 2015


On Tue, Apr 07, 2015 at 02:44:59PM +0300, Pekka Paalanen wrote:
> On Thu,  2 Apr 2015 19:16:49 -0700
> Bryce Harrington <bryce at osg.samsung.com> wrote:
> 
> > This enables tests to provide their own .ini files for configuring
> > weston, via the recently added --config option.  Also included in this
> > set is some related cleanup in weston-tests-env.
> > 
> > [Update v2]
> > Implemented review comments from pekka:
> >  * Dropped ~/.config as default location of weston.ini in help text.
> >  * Look for generated .ini files in build dir, as well as static ini
> >    files in the source tree (in tests/ subdir)
> >  * Simplified the .la/.so logic.
> >  * Added a test case for config loading
> > Also did some further fussy cleanup of weston-tests-env.
> > 
> > Bryce Harrington (9):
> >   compositor:  Help text for --config
> >   tests: Support --config to enable tests to override config defaults
> >   tests: Keep track of basename
> >   tests: Cleanup test log filenames
> >   tests: Refactor weston launching syntax
> >   tests: Simplify the .la/.so logic
> >   tests: Prefer bracket form of test command for consistency
> >   tests: Add a couple minor error checks
> >   tests: Add test to verify tests' ini files get loaded
> > 
> >  Makefile.am                   | 10 +++++-
> >  src/compositor.c              |  1 +
> >  tests/config-malformed-test.c | 33 ++++++++++++++++++++
> >  tests/config-malformed.ini    | 15 +++++++++
> >  tests/weston-tests-env        | 71 +++++++++++++++++++++----------------------
> >  5 files changed, 93 insertions(+), 37 deletions(-)
> >  create mode 100644 tests/config-malformed-test.c
> >  create mode 100644 tests/config-malformed.ini
> > 
> 
> Hi,
> 
> I cherry-picked and pushed patches 1, 3, 4 and 7. Patch 3 I had to
> rebase a bit, because I didn't pick patch 2 yet.
>    04f8a9b..b9ec2be  master -> master
> 
> Patch 8 looks good, but the unrelated changes in it make rebasing it
> inconvenient - basically a rewrite.
> 
> For patch 9 I already sent my comments separately and agree with Marek.
> 
> Now, previously I was concerned that these clean-ups (patches 2, 5, 6)
> would actually make weston-tests-env harder to read. I still wasn't
> sure, so I tried it and rebased my ivi-test-5 branch on top your
> complete series:
> http://cgit.collabora.com/git/user/pq/weston.git/log/?h=ivi-test-5b
> 
> After my rebase, weston-tests-env now looks like this:
> --------------------------------------------------
> 
> #!/bin/bash
> 
> TEST_FILE=${1##*/}
> TEST_NAME=${TEST_FILE%.*}
> 
> if [ -z "$TEST_NAME" ]; then
> 	echo "usage: $(basename $0) <test name>"
> 	exit 1;
> fi
> 
> WESTON=$abs_builddir/weston
> LOGDIR=$abs_builddir/logs
> mkdir -p "$LOGDIR" || exit
> 
> OUTLOG="$LOGDIR/${TEST_NAME}-log.txt"
> SERVERLOG="$LOGDIR/${TEST_NAME}-serverlog.txt"
> rm -f "$SERVERLOG" || exit
> 
> client=
> BACKEND=${BACKEND:-headless-backend.so}
> MODDIR=$abs_builddir/.libs
> TEST_MODULE=$MODDIR/${TEST_FILE/.la/.so}
> SHELL_PLUGIN=$MODDIR/desktop-shell.so
> XWAYLAND_PLUGIN=$MODDIR/xwayland.so
> 
> if [[ ${TEST_MODULE} != *.so ]]; then
> 	export WESTON_TEST_CLIENT_PATH=$abs_builddir/$TEST_FILE
> 	client=$($WESTON_TEST_CLIENT_PATH --params)
> 	TEST_MODULE=$MODDIR/weston-test.so
> fi
> 
> CONFIG_FILE="${TEST_NAME}.ini"
> if [ -e "${abs_builddir}/${CONFIG_FILE}" ]; then
> 	CONFIG="--config=${abs_builddir}/${CONFIG_FILE}"
> elif [ -e "${abs_top_srcdir}/tests/${CONFIG_FILE}" ]; then
> 	CONFIG="--config=${abs_top_srcdir}/tests/${CONFIG_FILE}"
> else
> 	CONFIG="--no-config"
> fi
> 
> if [[ ${TEST_NAME} = ivi-* ]]; then
> 	SHELL_PLUGIN=$MODDIR/ivi-shell.so
> 	if [[ "$CONFIG" = "--no-config" ]]; then
> 		CONFIG="--config=$abs_builddir/tests/weston-ivi.ini"
> 	fi
> 	XWAYLAND_PLUGIN=""
> fi
> 
> if [[ ${TEST_FILE} = ivi-*.la ]]; then
> 	client="$client --ivi-module=$TEST_MODULE"
> 	TEST_MODULE=$MODDIR/weston-test.so
> fi
> 
> export WESTON_BUILD_DIR=$abs_builddir
> $WESTON \
> 	--shell=$SHELL_PLUGIN \
> 	--socket=test-${TEST_NAME} \
> 	--modules=$TEST_MODULE,$XWAYLAND_PLUGIN \
> 	--backend=$MODDIR/$BACKEND \
> 	--log="$SERVERLOG" \
> 	$CONFIG \
> 	$client \
> 	&> "$OUTLOG"
> 
> --------------------------------------------------
> 
> Is this what you meant?

Yes, that looks good.

> Thanks,
> pq


More information about the wayland-devel mailing list