[PATCH v3 wayland-protocols] test: add make check
Derek Foreman
derekf at osg.samsung.com
Tue Jan 12 09:27:55 PST 2016
We can now test all the protocol files by running make check (or distcheck)
which will pass them through the scanner.
Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
Changes from v1:
Use #/bin/sh -e and drop the && from the script
Discover the scanner's location and use it
Changes from v2:
use dist_check_SCRIPTS instead of EXTRA_DIST
add the stable protocols as an empty var
.gitignore | 3 +++
Makefile.am | 10 ++++++++++
configure.ac | 6 ++++++
tests/scan.sh | 5 +++++
4 files changed, 24 insertions(+)
create mode 100755 tests/scan.sh
diff --git a/.gitignore b/.gitignore
index e6f85d0..ca19ecf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,6 @@ missing
*.pc
autom4te.cache
aclocal.m4
+*.trs
+*.log
+test-driver
diff --git a/Makefile.am b/Makefile.am
index 5926a41..582b3f2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,6 +7,9 @@ unstable_protocols = \
unstable/xdg-shell/xdg-shell-unstable-v5.xml \
$(NULL)
+stable_protocols = \
+ $(NULL)
+
nobase_dist_pkgdata_DATA = \
$(unstable_protocols) \
$(NULL)
@@ -16,3 +19,10 @@ dist_noinst_DATA = \
$(NULL)
noarch_pkgconfig_DATA = wayland-protocols.pc
+
+dist_check_SCRIPTS = tests/scan.sh
+
+TESTS = $(unstable_protocols) $(stable_protocols)
+TEST_EXTENSIONS = .xml
+AM_TESTS_ENVIRONMENT = SCANNER='$(wayland_scanner)'; export SCANNER;
+XML_LOG_COMPILER = $(srcdir)/tests/scan.sh
diff --git a/configure.ac b/configure.ac
index c51b7fc..dc5d899 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,6 +15,12 @@ AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([WAYLAND_PROTOCOLS_VERSION], [wayland_protocols_version])
+AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+if test x$wayland_scanner = x; then
+ PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
+ wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+fi
+
AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
AM_SILENT_RULES([yes])
diff --git a/tests/scan.sh b/tests/scan.sh
new file mode 100755
index 0000000..fd92bec
--- /dev/null
+++ b/tests/scan.sh
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+$SCANNER client-header $1 /dev/null
+$SCANNER server-header $1 /dev/null
+$SCANNER code $1 /dev/null
--
2.6.4
More information about the wayland-devel
mailing list