[PATCH libinput 1/2] add simple symbols leak checker

Marek Chalupa mchqwerty at gmail.com
Wed Jan 21 03:11:21 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.

Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
---
 test/Makefile.am          |  7 ++++++-
 test/symbols-leak-test.sh | 17 +++++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100755 test/symbols-leak-test.sh

diff --git a/test/Makefile.am b/test/Makefile.am
index 1b7ba87..2bd3e13 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -48,8 +48,13 @@ build_tests = \
 	test-build-pedantic-c99 \
 	test-build-std-gnuc90
 
+
 noinst_PROGRAMS = $(build_tests) $(run_tests)
-TESTS = $(run_tests)
+TESTS = $(run_tests) symbols-leak-test.sh
+
+# symbol-leak-test.sh needs a dummy target, or we'll get error
+# while make check
+symbols-leak-test.sh:
 
 .NOTPARALLEL:
 
diff --git a/test/symbols-leak-test.sh b/test/symbols-leak-test.sh
new file mode 100755
index 0000000..d32cffa
--- /dev/null
+++ b/test/symbols-leak-test.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+# simple check for exported symbols
+
+# make sure the paths are alright
+cd `dirname $0`
+
+cat ../src/libinput.sym| grep '^\s\+libinput_.*' | sed -e 's/^\s\+\(.*\);/\1/' |  sort > libinput.sym.symbols
+
+cat ../src/*.c | grep LIBINPUT_EXPORT -A 1 | grep '^libinput_.*' | sed -e 's/(.*//' | sort > exported.symbols
+
+diff -a libinput.sym.symbols exported.symbols
+CODE=$?
+
+rm libinput.sym.symbols exported.symbols
+
+exit $CODE
-- 
2.2.1



More information about the wayland-devel mailing list