[PATCH weston] tests: add simple installcheck test for the weston sdk

U. Artie Eoff ullysses.a.eoff at intel.com
Mon May 13 18:13:55 PDT 2013


From: "U. Artie Eoff" <ullysses.a.eoff at intel.com>

This test should be executed with 'make installcheck' after
running 'make install'.  It is a simple, basic test that attempts
to compile a trivial (and inherently useless) weston sdk module
to ensure the exported SDK can be used by consumers.

Any improvements are welcome.

Signed-off-by: U. Artie Eoff <ullysses.a.eoff at intel.com>
---
 tests/Makefile.am       |  5 ++++-
 tests/installcheck-test | 41 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 tests/installcheck-test

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9f711cf..69a3e22 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -115,7 +115,10 @@ if BUILD_SETBACKLIGHT
 setbacklight = setbacklight
 endif
 
-EXTRA_DIST = weston-tests-env
+installcheck-local:
+	$(SHELL) ./installcheck-test
+
+EXTRA_DIST = weston-tests-env installcheck-test
 
 BUILT_SOURCES =					\
 	subsurface-protocol.c			\
diff --git a/tests/installcheck-test b/tests/installcheck-test
new file mode 100644
index 0000000..f73b91b
--- /dev/null
+++ b/tests/installcheck-test
@@ -0,0 +1,41 @@
+#!/bin/bash
+#
+# Copyright © 2013 Intel Corporation
+#
+# Permission to use, copy, modify, distribute, and sell this software and
+# its documentation for any purpose is hereby granted without fee, provided
+# that the above copyright notice appear in all copies and that both that
+# copyright notice and this permission notice appear in supporting
+# documentation, and that the name of the copyright holders not be used in
+# advertising or publicity pertaining to distribution of the software
+# without specific, written prior permission.  The copyright holders make
+# no representations about the suitability of this software for any
+# purpose.  It is provided "as is" without express or implied warranty.
+#
+# THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+# SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+# FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+# RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+# CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+set -x
+
+TMPFILE=/tmp/weston-sdk-ic$$
+cat << EOF >> $TMPFILE.c
+#include <weston/compositor.h>
+WL_EXPORT int
+module_init(struct weston_compositor *compositor,
+	int *argc, char *argv[], const char *config_file);
+EOF
+
+gcc -c `pkg-config pixman-1 weston --cflags` $TMPFILE.c -o $TMPFILE.o
+gcc -shared $TMPFILE.o `pkg-config weston --libs` -o $TMPFILE.so
+
+set RESULT=$?
+
+rm $TMPFILE.c $TMPFILE.o $TMPFILE.so
+
+exit $RESULT
-- 
1.7.11.7



More information about the wayland-devel mailing list