2012-12-12 16:26:38 +04:00
|
|
|
#!/bin/bash
|
2012-04-12 20:54:14 +04:00
|
|
|
|
2015-04-03 05:16:52 +03:00
|
|
|
TEST_FILE=${1##*/}
|
|
|
|
TEST_NAME=${TEST_FILE%.*}
|
2013-09-11 09:58:08 +04:00
|
|
|
|
2015-04-03 05:16:52 +03:00
|
|
|
if test -z "$TEST_NAME"; then
|
2013-09-11 09:58:08 +04:00
|
|
|
echo "usage: $(basename $0) <test name>"
|
|
|
|
exit 1;
|
|
|
|
fi
|
|
|
|
|
2014-02-01 02:03:09 +04:00
|
|
|
WESTON=$abs_builddir/weston
|
2012-12-12 16:26:38 +04:00
|
|
|
LOGDIR=$abs_builddir/logs
|
|
|
|
|
|
|
|
mkdir -p "$LOGDIR"
|
|
|
|
|
|
|
|
SERVERLOG="$LOGDIR/$1-serverlog.txt"
|
|
|
|
OUTLOG="$LOGDIR/$1-log.txt"
|
|
|
|
|
|
|
|
rm -f "$SERVERLOG"
|
2012-04-12 20:54:14 +04:00
|
|
|
|
2014-02-07 12:34:47 +04:00
|
|
|
if test -z "$BACKEND"; then
|
|
|
|
BACKEND=headless-backend.so
|
2012-12-15 01:19:43 +04:00
|
|
|
fi
|
|
|
|
|
2015-03-24 16:56:16 +03:00
|
|
|
MODDIR=$abs_builddir/.libs
|
|
|
|
|
|
|
|
SHELL_PLUGIN=$MODDIR/desktop-shell.so
|
|
|
|
TEST_PLUGIN=$MODDIR/weston-test.so
|
|
|
|
XWAYLAND_PLUGIN=$MODDIR/xwayland.so
|
2014-02-07 12:34:47 +04:00
|
|
|
|
2015-04-03 05:16:52 +03:00
|
|
|
case $TEST_FILE in
|
2012-12-08 01:50:31 +04:00
|
|
|
*.la|*.so)
|
2014-08-21 20:32:38 +04:00
|
|
|
WESTON_BUILD_DIR=$abs_builddir \
|
2015-03-24 16:56:16 +03:00
|
|
|
$WESTON --backend=$MODDIR/$BACKEND \
|
2014-05-07 17:26:26 +04:00
|
|
|
--no-config \
|
2014-05-07 17:26:28 +04:00
|
|
|
--shell=$SHELL_PLUGIN \
|
2015-04-03 05:16:52 +03:00
|
|
|
--socket=test-${TEST_NAME} \
|
|
|
|
--modules=$MODDIR/${TEST_FILE/.la/.so},$XWAYLAND_PLUGIN \
|
2012-12-12 16:26:38 +04:00
|
|
|
--log="$SERVERLOG" \
|
|
|
|
&> "$OUTLOG"
|
2012-12-08 01:50:31 +04:00
|
|
|
;;
|
|
|
|
*)
|
2014-08-21 20:32:38 +04:00
|
|
|
WESTON_BUILD_DIR=$abs_builddir \
|
2015-04-03 05:16:52 +03:00
|
|
|
WESTON_TEST_CLIENT_PATH=$abs_builddir/$TEST_FILE $WESTON \
|
|
|
|
--socket=test-${TEST_NAME} \
|
2015-03-24 16:56:16 +03:00
|
|
|
--backend=$MODDIR/$BACKEND \
|
2014-05-07 17:26:26 +04:00
|
|
|
--no-config \
|
2014-05-07 17:26:28 +04:00
|
|
|
--shell=$SHELL_PLUGIN \
|
2012-12-12 16:26:38 +04:00
|
|
|
--log="$SERVERLOG" \
|
2014-05-07 17:26:27 +04:00
|
|
|
--modules=$TEST_PLUGIN,$XWAYLAND_PLUGIN \
|
2015-04-03 05:16:52 +03:00
|
|
|
$($abs_builddir/$TEST_FILE --params) \
|
2012-12-12 16:26:38 +04:00
|
|
|
&> "$OUTLOG"
|
2012-12-08 01:50:31 +04:00
|
|
|
esac
|