[PATCH weston v2 6/7] tests: Drop weston-tests-env

Quentin Glidic sardemff7+wayland at sardemff7.net
Fri Apr 26 06:16:05 PDT 2013


From: Quentin Glidic <sardemff7+git at sardemff7.net>

This file is no longer needed using the parallel-tests feature of
automake
This also allows users to pass additional arguments to weston and to
force a backend
This change is still compatible with automake 1.11 without needing the
export hack any more

Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
---
 tests/.gitignore       |  3 ++-
 tests/Makefile.am      | 53 +++++++++++++++++++++++++++++++++++---------------
 tests/weston-tests-env | 39 -------------------------------------
 3 files changed, 39 insertions(+), 56 deletions(-)
 delete mode 100755 tests/weston-tests-env

diff --git a/tests/.gitignore b/tests/.gitignore
index ab85338..441f66a 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,6 +1,7 @@
 *.test
 *.weston
-logs
+*.log
+*.trs
 matrix-test
 setbacklight
 test-client
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 2a48c12..23cc795 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -3,7 +3,12 @@ TESTS = $(shared_tests) $(module_tests) $(weston_tests)
 shared_tests =				\
 	option-parser.test
 
+# Keep them in sync
 module_tests =				\
+	.libs/surface-test.so		\
+	.libs/surface-global-test.so
+
+module_tests_la = \
 	surface-test.la			\
 	surface-global-test.la
 
@@ -14,28 +19,44 @@ weston_tests =				\
 	text.weston			\
 	$(xwayland_test)
 
-AM_TESTS_ENVIRONMENT = \
-	abs_builddir='$(abs_builddir)'; export abs_builddir;
-
-TEST_EXTENSIONS = .la .weston
-LA_LOG_COMPILER = $(srcdir)/weston-tests-env
-WESTON_LOG_COMPILER = $(srcdir)/weston-tests-env
-
-clean-local:
-	-rm -rf logs
-
-# To remove when automake 1.11 support is dropped
-export abs_builddir
-
-noinst_LTLIBRARIES =			\
-	$(weston_test)
+TEST_WESTON  ?= $(top_builddir)/src/weston
+
+ #ifneq ($(strip $(WAYLAND_DISPLAY)),)
+ ifdef WAYLAND_DISPLAY
+TEST_BACKEND ?= $(top_builddir)/src/.libs/wayland-backend.so
+ else ifneq ($(strip $(DISPLAY)),)
+TEST_BACKEND ?= $(top_builddir)/src/.libs/x11-backend.so
+ else
+TEST_BACKEND ?= $(top_builddir)/src/.libs/headless-backend.so
+ endif
+
+TEST_EXTENSIONS = .weston .so
+
+WESTON_LOG_COMPILER = $(TEST_WESTON)
+SO_LOG_COMPILER = $(TEST_WESTON)
+
+# Keep --test-client as the last arg, so it grabs the test client in
+AM_WESTON_LOG_FLAGS = \
+	--modules xwayland.so \
+	--backend $(TEST_BACKEND) \
+	--socket test-socket-$(notdir $@) \
+	--modules $(builddir)/.libs/weston-test.so \
+	--test-client
+
+# Keep --modules as the last arg, so it grabs the test module in
+AM_SO_LOG_FLAGS = \
+	--modules xwayland.so \
+	--backend $(TEST_BACKEND) \
+	--socket test-socket-$(notdir $@) \
+	--modules
 
 noinst_PROGRAMS =			\
 	$(setbacklight)			\
 	matrix-test
 
 check_LTLIBRARIES =			\
-	$(module_tests)
+	$(module_tests_la)		\
+	$(weston_test)
 
 check_PROGRAMS =			\
 	$(shared_tests)			\
diff --git a/tests/weston-tests-env b/tests/weston-tests-env
deleted file mode 100755
index 2c2d2fa..0000000
--- a/tests/weston-tests-env
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/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"
-
-if test x$WAYLAND_DISPLAY != x; then
-	BACKEND=$abs_builddir/../src/.libs/wayland-backend.so
-elif test x$DISPLAY != x; then
-	BACKEND=$abs_builddir/../src/.libs/x11-backend.so
-else
-	BACKEND=$abs_builddir/../src/.libs/wayland-backend.so
-fi
-
-case $1 in
-	*.la|*.so)
-		$WESTON --backend=$BACKEND \
-			--socket=test-$(basename $1) \
-			--modules=xwayland.so \
-			--modules=$abs_builddir/.libs/${1/.la/.so} \
-			--log="$SERVERLOG" \
-			&> "$OUTLOG"
-		;;
-	*)
-		$WESTON \
-			--socket=test-$(basename $1) \
-			--backend=$BACKEND \
-			--log="$SERVERLOG" \
-			--modules=xwayland.so \
-			--modules=$abs_builddir/.libs/weston-test.so \
-			--test-client=$abs_builddir/$1 \
-			&> "$OUTLOG"
-esac
-- 
1.8.2.1



More information about the wayland-devel mailing list