[PATCH 2/5] tests: Support --config to enable tests to override config defaults

Pekka Paalanen ppaalanen at gmail.com
Thu Apr 2 03:52:03 PDT 2015


On Wed,  1 Apr 2015 19:17:04 -0700
Bryce Harrington <bryce at osg.samsung.com> wrote:

> Implements a simple mechanism to allow tests to customize the
> configuration.  Just place a <test>.ini file at the same location as the
> test itself.  If no configuration file is found, then no configuration
> will be used (i.e. --no-config is specified.)
> 
> Signed-off-by: Bryce Harrington <bryce at osg.samsung.com>
> ---
>  tests/weston-tests-env | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/weston-tests-env b/tests/weston-tests-env
> index 4d9ba88..070c686 100755
> --- a/tests/weston-tests-env
> +++ b/tests/weston-tests-env
> @@ -27,11 +27,18 @@ SHELL_PLUGIN=$MODDIR/desktop-shell.so
>  TEST_PLUGIN=$MODDIR/weston-test.so
>  XWAYLAND_PLUGIN=$MODDIR/xwayland.so
>  
> +CONFIG_FILE="$abs_builddir/$(basename $TESTNAME).ini"

Hi,

I don't think this works, if builddir != srcdir. Then again, if one
provides a hardcoded file, it will be in srcdir, but if it is
generated, it will be in builddir. Check for both, prefer builddir?

Btw. a user would be nice. Even if it's stupid... would allow to test
the test framework.


Thanks,
pq

> +if [ -e "${CONFIG_FILE}" ]; then
> +	CONFIG="--config=${CONFIG_FILE}"
> +else
> +	CONFIG="--no-config"
> +fi
> +
>  case $TESTNAME in
>  	*.la|*.so)
>  		WESTON_BUILD_DIR=$abs_builddir \
>  		$WESTON --backend=$MODDIR/$BACKEND \
> -			--no-config \
> +			$CONFIG \
>  			--shell=$SHELL_PLUGIN \
>  			--socket=test-$(basename $TESTNAME) \
>  			--modules=$MODDIR/${TESTNAME/.la/.so},$XWAYLAND_PLUGIN \
> @@ -43,7 +50,7 @@ case $TESTNAME in
>  		WESTON_TEST_CLIENT_PATH=$abs_builddir/$TESTNAME $WESTON \
>  			--socket=test-$(basename $TESTNAME) \
>  			--backend=$MODDIR/$BACKEND \
> -			--no-config \
> +			$CONFIG \
>  			--shell=$SHELL_PLUGIN \
>  			--log="$SERVERLOG" \
>  			--modules=$TEST_PLUGIN,$XWAYLAND_PLUGIN \



More information about the wayland-devel mailing list