summaryrefslogtreecommitdiff
path: root/test/symbols-leak-test.in
diff options
context:
space:
mode:
authorMarek Chalupa <mchqwerty@gmail.com>2015-02-12 09:25:36 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2015-02-13 10:20:44 +1000
commita9f216ab47ea2f643f20ed741b741a2b5766eba3 (patch)
treec1a491cc6f28769479e8a3e32135716a60b22ade /test/symbols-leak-test.in
parentd6da0e18c21a18c00c29104a8ba2febe1315207c (diff)
add simple symbols leak checker
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@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'test/symbols-leak-test.in')
-rwxr-xr-xtest/symbols-leak-test.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/symbols-leak-test.in b/test/symbols-leak-test.in
new file mode 100755
index 00000000..448ef2f8
--- /dev/null
+++ b/test/symbols-leak-test.in
@@ -0,0 +1,17 @@
+#!/bin/bash
+
+### simple check for exported symbols
+
+# make bash exit if any command will exit with non-0 return value
+set -e
+
+# 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)