[PATCH v3 libinput] add simple symbols leak checker
Marek Chalupa
mchqwerty at gmail.com
Thu Feb 5 00:33:19 PST 2015
This patch adds simple script that compares libinput.sym file to the
functions that are marked by LIBINPUT_EXPORT. This script is added
to make check target.
v2. use noinst_SCRIPTS instead of dummy target
drop .sh suffix
generate the script from .in file
use -u swich when running diff
v3. use AC_CONFIG_FILES to generate scripts from .in file
use pipes instead of creating files
Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
---
configure.ac | 2 ++
test/Makefile.am | 3 ++-
test/symbols-leak-test.in | 17 +++++++++++++++++
3 files changed, 21 insertions(+), 1 deletion(-)
create mode 100755 test/symbols-leak-test.in
diff --git a/configure.ac b/configure.ac
index 803d573..dea65bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,6 +164,8 @@ AC_CONFIG_FILES([Makefile
src/libinput-version.h
test/Makefile
tools/Makefile])
+AC_CONFIG_FILES([test/symbols-leak-test], [chmod +x test/symbols-leak-test])
+
AC_OUTPUT
AC_MSG_RESULT([
diff --git a/test/Makefile.am b/test/Makefile.am
index 5b9c7ab..5743ca4 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -50,7 +50,8 @@ build_tests = \
test-build-std-gnuc90
noinst_PROGRAMS = $(build_tests) $(run_tests)
-TESTS = $(run_tests)
+noinst_SCRIPTS = symbols-leak-test
+TESTS = $(run_tests) symbols-leak-test
.NOTPARALLEL:
diff --git a/test/symbols-leak-test.in b/test/symbols-leak-test.in
new file mode 100755
index 0000000..4b315ed
--- /dev/null
+++ b/test/symbols-leak-test.in
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+### simple check for exported symbols
+
+# make sure the paths are alright
+cd `dirname $0`
+
+diff -a -u \
+ <(cat @top_srcdir@/src/libinput.sym | \
+ grep '^\s\+libinput_.*' | \
+ sed -e 's/^\s\+\(.*\);/\1/' | sort) \
+ <(cat @top_srcdir@/src/*.c | \
+ grep LIBINPUT_EXPORT -A 1 | grep '^libinput_.*' | \
+ sed -e 's/(.*//' | sort)
+CODE=$?
+
+exit $CODE
--
2.2.2
More information about the wayland-devel
mailing list